Skip to main content

Python client for Kospel C.MI electric heater HTTP API

Project description

kospel-cmi-lib

Python client for the Kospel C.MI electric heater HTTP API.

Features

  • Async-first: Built on asyncio and aiohttp for non-blocking I/O
  • Type-safe: Strict type hinting throughout
  • Registry-driven: Settings defined declaratively in a central registry; dynamic property access on HeaterController
  • Simulator-capable: Full simulator for offline development and testing (no hardware required)
  • Protocol-based: Decoder/encoder interfaces via Python Protocol types

Installation

# With uv (recommended)
uv add kospel-cmi-lib

# With pip
pip install kospel-cmi-lib

Usage

Use aiohttp.ClientSession and HeaterController to read and write heater settings:

import asyncio
import aiohttp
from kospel_cmi.controller.api import HeaterController


async def main() -> None:
    api_base_url = "http://192.168.1.1/api/dev/65"  # Replace with your heater URL
    async with aiohttp.ClientSession() as session:
        controller = HeaterController(session, api_base_url)
        await controller.refresh()
        print(controller.heater_mode)  # Access registry-defined settings as attributes
        # controller.heater_mode = "manual"  # Modify (if writable)
        # await controller.save()  # Write pending changes to the device


asyncio.run(main())

For offline development, enable the simulator (no HTTP calls):

controller = HeaterController(session, api_base_url, simulation_mode=True)
await controller.refresh()

You can also control simulation via the SIMULATION_MODE environment variable; see the technical documentation.

Documentation

License

Apache License 2.0

Links

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

kospel_cmi_lib-0.1.0a1.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

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

kospel_cmi_lib-0.1.0a1-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file kospel_cmi_lib-0.1.0a1.tar.gz.

File metadata

  • Download URL: kospel_cmi_lib-0.1.0a1.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.23

File hashes

Hashes for kospel_cmi_lib-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 742d6e90643d83b90d432bdc8eb8c3bb93790783ccb9c674d7baa1f85dba135f
MD5 67520510a9242b103f009e55af880671
BLAKE2b-256 e53f31fc4564b886ddb2485cae83a120d982c061147ef808d26027227cde4125

See more details on using hashes here.

File details

Details for the file kospel_cmi_lib-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for kospel_cmi_lib-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d5b4a3500c0a246c39dd36eeb58d752bec5fa3c5760583d3bab1383134ee55d
MD5 59c1f3160eac3d459cdb13628984c5fc
BLAKE2b-256 0bc1da8c91ae8b7beff2989379e725868554e0322d3f0907859ebc10058da4ed

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