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.18.tar.gz
(8.7 kB
view hashes)
Built Distribution
Close
Hashes for xcomfort-0.0.18-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00a100f6c63d495cbb3d15a499204d83286515be3cf0af4c08f33e9de4c6751d |
|
MD5 | 0f11d50c8bdbc7e712ca3d8672aa6a84 |
|
BLAKE2b-256 | 5f1d81451f2e9af818ad2dc2cdbb5fcb27a054001df8251f66237074c1bd4ae2 |