Skip to main content

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


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.1.2.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

xcomfort-0.1.2-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file xcomfort-0.1.2.tar.gz.

File metadata

  • Download URL: xcomfort-0.1.2.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for xcomfort-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8cf3701a086724d88c27389e89e4ac9caf61e2518b337a0f0172598030bc6683
MD5 7cd73bb3a74367515773c3321bd3296f
BLAKE2b-256 728d02ead248eaae28da2c63a3c249092c53fe4dfa2c1182b081687187a6609f

See more details on using hashes here.

File details

Details for the file xcomfort-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: xcomfort-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for xcomfort-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 05c71a8c1c2b3d93dae0b3bf0f4573a4e13a34a4cb11f50583ed95d39917dd82
MD5 a8d45b418a7b50c24fef09e487a769e4
BLAKE2b-256 40eaa8c68b35a71e5948547d7f297fff96a554d1c298d650d91f0e799954aa8b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page