diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2023-10-15 21:07:46 +0100 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2023-10-15 21:07:46 +0100 |
commit | 247a962c39e4ade2d9fb0b280d400d82fd8db56d (patch) | |
tree | 9b9c771a7e7e29fdf44165f0a24b493c60f7b732 /devices.py | |
parent | bbeeebb51fc9eb84cb976cb49ab2935f332f94ed (diff) | |
download | power.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.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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)) |