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).
WARNING: THIS PACKAGE IS PUBLISHED ONLY FOR TESTING THE PUBLIC INTERFACE AND IS NOT READY TO USE. MOST OF THE FEATURES ARE ONLY STUBS FOR NOW AND ARE NOT IMPLEMENTED YET. IMPLEMENTED FEATURES HAVE NOT RECEIVED ANY TESTING YET. DO NOT DOWNLOAD THIS PACKAGE IF YOU ARE AN OUTSIDE DEVELOPER NOT INVOLVED IN THE LIBRARY DEVELOPMENT.
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.3.1.tar.gz
(12.1 kB
view hashes)
Built Distribution
Close
Hashes for inels_mqtt_wrapper-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6e2e12a86cad105e5935fb6a47ad94f2f91656bfa46d9445a7a7c07a464903d |
|
MD5 | 531378264722811dbd5a66b5f2f120a5 |
|
BLAKE2b-256 | d05627e6e7e9e7f0bdbc6f4aaa24fcb13b0d5fe42bf1f18382ec2a5516b92199 |