From 247a962c39e4ade2d9fb0b280d400d82fd8db56d Mon Sep 17 00:00:00 2001 From: jwansek Date: Sun, 15 Oct 2023 21:07:46 +0100 Subject: Added plug usage table to web UI, with HTTP requests --- devices.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'devices.py') 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)) -- cgit v1.2.3