Integration with Eaton xComfort Bridge
Project description
xcomfort-python
Unofficial python package for communicating with Eaton xComfort Bridge
Usage
import asyncio
from xcomfort import Bridge
def observe_device(device):
device.state.subscribe(lambda state: print(f"Device state [{device.device_id}] '{device.name}': {state}"))
async def main():
bridge = Bridge(<ip_address>, <auth_key>)
runTask = asyncio.create_task(bridge.run())
devices = await bridge.get_devices()
for device in devices.values():
observe_device(device)
# Wait 50 seconds. Try flipping the light switch manually while you wait
await asyncio.sleep(50)
# Turn off all the lights.
# for device in devices.values():
# await device.switch(False)
#
# await asyncio.sleep(5)
await bridge.close()
await runTask
asyncio.run(main())
Tests
python -m pytest
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
xcomfort-0.0.21.tar.gz
(10.1 kB
view hashes)
Built Distribution
xcomfort-0.0.21-py3-none-any.whl
(10.8 kB
view hashes)
Close
Hashes for xcomfort-0.0.21-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13c6a2a838cacfbbaa96e4da93e803455abeaafc5c18a8d3b3cd22f9181bb2e2 |
|
MD5 | 142105dea1b02d221878f9bcb3223a74 |
|
BLAKE2b-256 | a38b0b771ad121532e75f826b6e6e6fd32be1044d9591f9dd85cc0cb602726e8 |