A Python library to work with Inels devices over MQTT (using Asyncio)
Project description
Inels MQTT wrapper
A Python library to work with Inels smart home devices over MQTT (using Asyncio).
Demo code
Below is a simple code snippet to demonstrate the basic interaction with this library.
import asyncio
import asyncio_mqtt as aiomqtt
from inels_mqtt_wrapper import RFDAC71B, DeviceStatusUnknownError
async def main() -> None:
"""Entrypoint"""
async with aiomqtt.Client("localhost") as client:
device = RFDAC71B(
mac_address="00:00:00:00:00:00", # Your gateway's MAC address
device_address="01207D", # Your device's address (found on the device's top case)
mqtt_client=client, # An instance of asyncio_mqtt.Client
)
print("Connected:", device.is_connected) # True
try:
print(device.status) # A dict containing device-specific status data
except DeviceStatusUnknownError as e:
print(e) # Print the error if the device status is unknown
await device.set_brightness_percentage(50) # Set the device's brightness to 50%
await device.without_function() # Apply the before set brightness percentage
try:
print(device.status) # Check the device status again
except DeviceStatusUnknownError as e:
print(e) # Print the error if the device status is unknown
if __name__ == "__main__":
asyncio.run(main())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
inels-mqtt-wrapper-0.1.0.tar.gz
(12.4 kB
view hashes)
Built Distribution
Close
Hashes for inels_mqtt_wrapper-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5388b28398faa5a7a2fb856cc6eafabfa86ef28c674dbe0b65e25fc3f348a9b6 |
|
MD5 | f39f574f317bdc66b4ec7bf0d7e7cfdc |
|
BLAKE2b-256 | 5d49a910ca2fe9657ab5341414724d0c18f96aafeb961faf7b4cbcbafb8a9a5a |