aboutsummaryrefslogtreecommitdiffstats
path: root/devices.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2023-10-15 21:07:46 +0100
committerjwansek <eddie.atten.ea29@gmail.com>2023-10-15 21:07:46 +0100
commit247a962c39e4ade2d9fb0b280d400d82fd8db56d (patch)
tree9b9c771a7e7e29fdf44165f0a24b493c60f7b732 /devices.py
parentbbeeebb51fc9eb84cb976cb49ab2935f332f94ed (diff)
downloadpower.eda.gay-247a962c39e4ade2d9fb0b280d400d82fd8db56d.tar.gz
power.eda.gay-247a962c39e4ade2d9fb0b280d400d82fd8db56d.zip
Added plug usage table to web UI, with HTTP requests
Diffstat (limited to 'devices.py')
-rw-r--r--devices.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/devices.py b/devices.py
index f8f17fe..4193780 100644
--- a/devices.py
+++ b/devices.py
@@ -38,7 +38,9 @@ def poll_watt_all():
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
with database.PowerDatabase(host = HOST) as db:
- for host, username, password in db.get_tasmota_devices():
+ devices = db.get_tasmota_devices()
+ print("There are devices: ", [i[0] for i in devices])
+ for host, username, password, description in devices:
while True:
try:
asyncio.run(poll_watt_for(db, host, username, password))
@@ -52,7 +54,7 @@ def poll_kwh_all():
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
with database.PowerDatabase(host = HOST) as db:
- for host, username, password in db.get_tasmota_devices():
+ for host, username, password, description in db.get_tasmota_devices():
while True:
try:
asyncio.run(poll_yesterday_kwh_for(db, host, username, password))