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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xcomfort-0.0.17-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xcomfort-0.0.17.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for xcomfort-0.0.17.tar.gz
Algorithm Hash digest
SHA256 e103053ab68aa1fa514aba412ad678f0c1bd54f5f03951b5aa91ca0a6393d8a6
MD5 429d40ed4fa842b0be2703ed706a4115
BLAKE2b-256 92211936e793836f83f08e2fc3df8d42a3d9e59c252945a03650bd9320039e6e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xcomfort-0.0.17-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for xcomfort-0.0.17-py3-none-any.whl
Algorithm Hash digest
SHA256 10c7c15cd63cceaf79d326be3dd68f4f0ea5ef767c300d895153b0d4a044cff0
MD5 05af8c413e69e935d30cf41b16281870
BLAKE2b-256 b02c4b68df1b5385297985afbbb3565d41993d724caa2551dcd885d3bff86ebf

See more details on using hashes here.

Supported by

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