Name | pypglab JSON |
Version |
0.0.3
JSON |
| download |
home_page | None |
Summary | An asynchronous Python library to communicate with PG LAB Electronics devices over MQTT. |
upload_time | 2024-11-12 22:22:01 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT 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
- Controll relays (turn on/off)
- Monitor relays status (on/off)
- Controll shutters (open/close/pause)
- Monitor shutters status (open/opening/closed/closing)
- Receiving device internal sensor update
## Devices supported
- E-Board
## Comming soon
- E-Switch
## Installation
```sh
pip install pypglab
```
## Usage
A client interface in pypglab/mqtt.py is used for the communication with MQTT broker.
The interface exposes callback for: publish, subscribe and unsubscribe.
Who is using pypglab library must manage the MQTT connection and define the MQTT client callback.
The following is a pseudo example that turn on all relays.
```python
from pypglab.device import Device
from pypglab.mqtt import Client
async def setup_pglab_device(config:dict):
async def mqtt_publish( topic: str, payload: str, qos: int | None = 0, retain: bool | None = False) -> None:
print("TODO... call the client MQTT publish")
pglab_mqtt_client = Client(mqtt_publish, None, None)
pglab_device = Device()
await pglab_device.config(pglab_mqtt_client, config, True)
for relay in pglab_device.relays:
await relay.turn_on()
```
For working 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 pglab.electronics@gmail.com
## 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/b9/15/2b54f7c225521fcbed6045d381b4af9f45c3745fad883907d068e86a5128/pypglab-0.0.3.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- Controll relays (turn on/off)\n- Monitor relays status (on/off)\n- Controll 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## Comming soon\n- E-Switch\n\n## Installation\n\n```sh\npip install pypglab\n```\n\n## Usage\n\nA client interface in pypglab/mqtt.py is used for the communication with MQTT broker.\nThe interface exposes callback for: publish, subscribe and unsubscribe.\nWho is using pypglab library must manage the MQTT connection and define the MQTT client callback.\n\nThe following is a pseudo example that turn on all relays.\n\n```python\nfrom pypglab.device import Device\nfrom pypglab.mqtt import Client\n\nasync def setup_pglab_device(config:dict):\n async def mqtt_publish( topic: str, payload: str, qos: int | None = 0, retain: bool | None = False) -> None:\n print(\"TODO... call the client MQTT publish\")\n\n pglab_mqtt_client = Client(mqtt_publish, None, None)\n pglab_device = Device()\n await pglab_device.config(pglab_mqtt_client, config, True)\n\n for relay in pglab_device.relays:\n await relay.turn_on() \n\n```\n\nFor working 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 pglab.electronics@gmail.com\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.3",
"project_urls": {
"Homepage": "https://github.com/pglab-electronics/pypglab"
},
"split_keywords": [
"pglab",
" pypglab"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "73f67ee8d4cae5013eeebb359f1b77aa77a38cad3f9f5ddcd260ed8a5076a034",
"md5": "e132ad2b12f7e695dbb5f55cbf71371f",
"sha256": "25f7db2b330fbbb0e91ea5a27341abd6b2f6da7aab4ab7d85d6aef374422c21d"
},
"downloads": -1,
"filename": "pypglab-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e132ad2b12f7e695dbb5f55cbf71371f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 11148,
"upload_time": "2024-11-12T22:21:59",
"upload_time_iso_8601": "2024-11-12T22:21:59.515480Z",
"url": "https://files.pythonhosted.org/packages/73/f6/7ee8d4cae5013eeebb359f1b77aa77a38cad3f9f5ddcd260ed8a5076a034/pypglab-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b9152b54f7c225521fcbed6045d381b4af9f45c3745fad883907d068e86a5128",
"md5": "124b0ed7f47da5a560da7aab61f0bade",
"sha256": "7cead3f8ed225ca70717418c115dbc485fe2f153b099e5d46bfd5ed6fc76f7c9"
},
"downloads": -1,
"filename": "pypglab-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "124b0ed7f47da5a560da7aab61f0bade",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 10522,
"upload_time": "2024-11-12T22:22:01",
"upload_time_iso_8601": "2024-11-12T22:22:01.473582Z",
"url": "https://files.pythonhosted.org/packages/b9/15/2b54f7c225521fcbed6045d381b4af9f45c3745fad883907d068e86a5128/pypglab-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-12 22:22:01",
"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"
}