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
asyncioandaiohttpfor 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
Protocoltypes
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
- Architecture — layers, components, and data flow
- Technical specifications — data formats, protocols, testing, and coding standards
License
Apache License 2.0
Links
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kospel_cmi_lib-0.1.0.tar.gz.
File metadata
- Download URL: kospel_cmi_lib-0.1.0.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be56c2e4812ca8be89314df96a13adb90d85d16f9c8606dc66507f93864c6b8d
|
|
| MD5 |
5f9288eb36be21e475ebed8e0f3a1db0
|
|
| BLAKE2b-256 |
4581280417a9dde8af80ce37593b89f898eb5fbf368bd4faf0099a6775836bca
|
File details
Details for the file kospel_cmi_lib-0.1.0-py3-none-any.whl.
File metadata
- Download URL: kospel_cmi_lib-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6992d739224a1157ef6c8808e7e40e63b3a00b3579887e66bb57122f6d9ffbd5
|
|
| MD5 |
ab32541d2559f8386a93cea87f6a7c5b
|
|
| BLAKE2b-256 |
6f6e848a967055b612518cb260e303c55bd97eceaeb82b2f9f6454767ddf9882
|