A Python wrapper to read out sensors from Technische Alternative using the C.M.I.
Project description
TA-CMI
A Python wrapper to read out sensors from Technische Alternative using the C.M.I.
How to use package
import asyncio
from ta_cmi import CMI, Languages, ApiError, RateLimitError, InvalidCredentialsError
async def main():
try:
cmi = CMI("http://192.168.1.101", "admin", "admin")
devices = await cmi.getDevices()
device = devices[0]
await device.update()
print(str(device))
inputChannels = device.inputs
outputChannels = device.outputs
for i in inputChannels:
ch = inputChannels.get(i)
print(str(ch))
for o in outputChannels:
ch = outputChannels.get(o)
print(f"{str(ch)} - {ch.getUnit(Languages.DE)}")
except (ApiError, RateLimitError, InvalidCredentialsError) as error:
print(f"Error: {error}")
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
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
ta-cmi-0.1.4.tar.gz
(6.3 kB
view hashes)
Built Distribution
Close
Hashes for ta_cmi-0.1.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d2eaa77b3e86a985a3aef93207760e8b4e6e98301169bfef57e8b1e6820be3f |
|
MD5 | 0fcaebfb76d1dcf667d58061ec85e5c0 |
|
BLAKE2b-256 | 2376355f365679499eeec471a28be91adc5417247c927b9a2ebb484f22726587 |