Copy in apsystems_ecur project from Github

https://github.com/ksheumaker/homeassistant-apsystems_ecur.git
This commit is contained in:
2021-06-22 04:09:05 +00:00
parent 9e1f55f7dc
commit 40eba650da
8 changed files with 908 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env python3
from APSystemsECUR import APSystemsECUR
import time
import asyncio
from pprint import pprint
ecu_ip = "192.168.0.251"
sleep = 60
loop = asyncio.get_event_loop()
ecu = APSystemsECUR(ecu_ip)
while True:
try:
data = loop.run_until_complete(ecu.async_query_ecu())
print(f"[OK] Timestamp: {data.get('timestamp')} Current Power: {data.get('current_power')}")
pprint(data)
except Exception as err:
print(f"[ERROR] {err}")
print(f"Sleeping for {sleep} sec")
time.sleep(sleep)