Skip to main content

ROX-ICU python driver

This package provides a high-level interface to ROX Integrated Control Unit.

For more information see product page

Cli

The package installs icu command line tool with fuctional commands

  mock     Mock ICU device on CAN bus
  monitor  Monitor ICU devices on CAN bus
  output   Set output state, provide hex value

Quick start

import asyncio
import logging

from rox_icu.core import ICU
from rox_icu.utils import run_main_async

NODE_ID = 1

SENSOR_PIN = 7
RELAY_PIN = 0

log = logging.getLogger("main")


async def handle_input(icu: ICU) -> None:
    log.info("Starting input handler")

    sensor = icu.pins[SENSOR_PIN]
    relay = icu.pins[RELAY_PIN]
    relay.state = False

    while True:
        log.info("Waiting for high state")
        await sensor.high_event.wait()
        log.info(f"Sensor state: {sensor.state}")

        # toggle relay
        relay.state = True
        await asyncio.sleep(0.1)
        relay.state = False


async def main() -> None:

    icu = ICU(NODE_ID)
    await icu.start()

    try:
        await handle_input(icu)
    finally:
        await icu.stop()
        print("Done")


if __name__ == "__main__":
    run_main_async(main())

Metadata

Release files for rox-icu 2.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rox-icu 2.5.1
File Size Uploaded
rox_icu-2.5.1.tar.gz 803.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rox-icu 2.5.1
File Interpreter ABI Platform
rox_icu-2.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 830.6 kB

Release files / rox_icu-2.5.1.tar.gz

Download URL rox_icu-2.5.1.tar.gz
Size 803.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e18fa9f3006ed51463b913b183691c84d113db7a065a26698985289ea689d712
BLAKE2b-256 checksum
How to use checksums
d544822d4f29ebb309697ff38f76366baa40f76386847ed95917b6eb7fd4f2da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.10

Release files / rox_icu-2.5.1-py3-none-any.whl

Download URL rox_icu-2.5.1-py3-none-any.whl
Size 26.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea9071e10d6b9e2f34d55285679f0100a3a4b64f9d8b50da1562fd96dc89d68c
BLAKE2b-256 checksum
How to use checksums
2a2b676874842f0cb8a2f739725288786bfeee0efc932528b459b62c61239a60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.10

Release history Release notifications | RSS feed

This release

2.5.1 This release

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page