pypglab


Namepypglab JSON
Version 0.0.2 PyPI version JSON
download
home_page
SummaryAn asynchronous Python library to communicate with PG LAB Electronics devices over MQTT.
upload_time2024-02-02 09:26:08
maintainer
docs_urlNone
author
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
- 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 comunication with MQTT broker.
The interface exposes callback for: publish, subscribe and unsusbribe.
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)

  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": "",
    "name": "pypglab",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "pglab, pypglab",
    "author": "",
    "author_email": "Pierluigi Garaventa <pglab.electronics@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/e2/42/6ff860457781b13da23b78e5a00fb35626eb8a1ab0b8bc8184ef0bec5837/pypglab-0.0.2.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 comunication with MQTT broker.\nThe interface exposes callback for: publish, subscribe and unsusbribe.\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)\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\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.2",
    "project_urls": {
        "Homepage": "https://github.com/pglab-electronics/pypglab"
    },
    "split_keywords": [
        "pglab",
        " pypglab"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1ec349daa6668700ea195ea4fea2f4e17e8e7398a4583cdfd566983d31bc8e85",
                "md5": "21e0bce7258aca51b70f02faf836f0ff",
                "sha256": "e6f6006b42376d426e76c9db379f6d32a0beec6a808d54ee0050cafa6cceb3cf"
            },
            "downloads": -1,
            "filename": "pypglab-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "21e0bce7258aca51b70f02faf836f0ff",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 11546,
            "upload_time": "2024-02-02T09:26:07",
            "upload_time_iso_8601": "2024-02-02T09:26:07.718135Z",
            "url": "https://files.pythonhosted.org/packages/1e/c3/49daa6668700ea195ea4fea2f4e17e8e7398a4583cdfd566983d31bc8e85/pypglab-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e2426ff860457781b13da23b78e5a00fb35626eb8a1ab0b8bc8184ef0bec5837",
                "md5": "01b8ed8ca77a19d5a6dccd8953aae99b",
                "sha256": "e81465b6df82f2468bcad76dd298eec9a2f3b147ed48ea429cef51e9a30d73be"
            },
            "downloads": -1,
            "filename": "pypglab-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "01b8ed8ca77a19d5a6dccd8953aae99b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 11242,
            "upload_time": "2024-02-02T09:26:08",
            "upload_time_iso_8601": "2024-02-02T09:26:08.959485Z",
            "url": "https://files.pythonhosted.org/packages/e2/42/6ff860457781b13da23b78e5a00fb35626eb8a1ab0b8bc8184ef0bec5837/pypglab-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-02 09:26:08",
    "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: 0.20836s