pypglab


Namepypglab JSON
Version 0.0.4 PyPI version JSON
download
home_pageNone
SummaryAn asynchronous Python library to communicate with PG LAB Electronics devices over MQTT.
upload_time2025-02-04 21:04:57
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License
keywords pglab pypglab
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# pypglab

## About

An asynchronous Python library to communicate with PG LAB Electronics devices over MQTT.

This library was created for Home Assistant integrations of PG LAB Electronics.

## Features

- Discover devices
- Control relays (turn on/off)
- Monitor relays status (on/off)
- Control shutters (open/close/pause)
- Monitor shutters status (open/opening/closed/closing)
- Receiving device internal sensor update

## Devices supported
- E-BOARD

## Coming soon
- E-SWITCH

## Installation

```sh
pip install pypglab
```

## Usage

The library has an helper class to simplify the discovery and the use of PG LAB Electronics devices.
The helper class hide the complexity to setup the MQTT connection with the broker.

In this simple working example pyPgLab class does the connection with the MQTT broker, retrieve an E-BOARD 
device and turn ON all available relay outputs

```python

from pypglab.helper import pyPgLab

def turn_relay(relay, on):
    if on:
        asyncio.run( relay.turn_on() )
    else:
        asyncio.run( relay.turn_off() )
    time.sleep(0.02)

pglab = pyPgLab()
pglab.start("192.168.1.8")
pglab.connect()

e_board = pglab.get_device_by_name("E-BOARD-DD53AC85")

if e_board :
    # turn all relay outputs ON
    for relay in e_board.relays:
        asyncio.run( relay.turn_on() )

pglab.stop()

```

For more example and proper setup of the MQTT connection and callback, 
see the example.py and the unittest of pypglab python library.

## Feedback

Please give us feedback on support@pglab.dev

## Founder

This plugin is created by PG Lab Electronics.

## License

Code is released under [MIT license]

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pypglab",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "pglab, pypglab",
    "author": null,
    "author_email": "Pierluigi Garaventa <pglab.electronics@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/11/0f/7034dc42e3f5a3d10776dd980b2f5cac8f5358d976113951cb7008ab615c/pypglab-0.0.4.tar.gz",
    "platform": null,
    "description": "\n# pypglab\n\n## About\n\nAn asynchronous Python library to communicate with PG LAB Electronics devices over MQTT.\n\nThis library was created for Home Assistant integrations of PG LAB Electronics.\n\n## Features\n\n- Discover devices\n- Control relays (turn on/off)\n- Monitor relays status (on/off)\n- Control shutters (open/close/pause)\n- Monitor shutters status (open/opening/closed/closing)\n- Receiving device internal sensor update\n\n## Devices supported\n- E-BOARD\n\n## Coming soon\n- E-SWITCH\n\n## Installation\n\n```sh\npip install pypglab\n```\n\n## Usage\n\nThe library has an helper class to simplify the discovery and the use of PG LAB Electronics devices.\nThe helper class hide the complexity to setup the MQTT connection with the broker.\n\nIn this simple working example pyPgLab class does the connection with the MQTT broker, retrieve an E-BOARD \ndevice and turn ON all available relay outputs\n\n```python\n\nfrom pypglab.helper import pyPgLab\n\ndef turn_relay(relay, on):\n    if on:\n        asyncio.run( relay.turn_on() )\n    else:\n        asyncio.run( relay.turn_off() )\n    time.sleep(0.02)\n\npglab = pyPgLab()\npglab.start(\"192.168.1.8\")\npglab.connect()\n\ne_board = pglab.get_device_by_name(\"E-BOARD-DD53AC85\")\n\nif e_board :\n    # turn all relay outputs ON\n    for relay in e_board.relays:\n        asyncio.run( relay.turn_on() )\n\npglab.stop()\n\n```\n\nFor more example and proper setup of the MQTT connection and callback, \nsee the example.py and the unittest of pypglab python library.\n\n## Feedback\n\nPlease give us feedback on support@pglab.dev\n\n## Founder\n\nThis plugin is created by PG Lab Electronics.\n\n## License\n\nCode is released under [MIT license]\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "An asynchronous Python library to communicate with PG LAB Electronics devices over MQTT.",
    "version": "0.0.4",
    "project_urls": {
        "Homepage": "https://github.com/pglab-electronics/pypglab"
    },
    "split_keywords": [
        "pglab",
        " pypglab"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1dbdf7e141e6f264bddf010afc260896e8a37e7d9d8e2874cb22c4d369ef76c0",
                "md5": "7f7885374af777ba9c761cc4c663bc19",
                "sha256": "213c6c55394c63b4c0e36092afb1919e78e932a4d4d563db94744852cfdc8e95"
            },
            "downloads": -1,
            "filename": "pypglab-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7f7885374af777ba9c761cc4c663bc19",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 12640,
            "upload_time": "2025-02-04T21:04:55",
            "upload_time_iso_8601": "2025-02-04T21:04:55.515821Z",
            "url": "https://files.pythonhosted.org/packages/1d/bd/f7e141e6f264bddf010afc260896e8a37e7d9d8e2874cb22c4d369ef76c0/pypglab-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "110f7034dc42e3f5a3d10776dd980b2f5cac8f5358d976113951cb7008ab615c",
                "md5": "694cb468d5181dddb00a0632ff83105b",
                "sha256": "83bcd46fe1d5e64624e0d0971ea6a4af3fefda61dd1f747cd3478a67b0ec49b4"
            },
            "downloads": -1,
            "filename": "pypglab-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "694cb468d5181dddb00a0632ff83105b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 11400,
            "upload_time": "2025-02-04T21:04:57",
            "upload_time_iso_8601": "2025-02-04T21:04:57.847222Z",
            "url": "https://files.pythonhosted.org/packages/11/0f/7034dc42e3f5a3d10776dd980b2f5cac8f5358d976113951cb7008ab615c/pypglab-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-04 21:04:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pglab-electronics",
    "github_project": "pypglab",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pypglab"
}
        
Elapsed time: 1.35484s