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.1.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for ta_cmi-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a897a66572d45873a1d6327b69e5ef82072bf594990bb62ca835c9ceb57ca451 |
|
MD5 | 81a289ec759a943be89a6a023edf95b0 |
|
BLAKE2b-256 | 527e3a9b10dc348f79e944ed028be629d5b1d2ac881f69774be7e34573ab3a51 |