aboutsummaryrefslogtreecommitdiffstats
path: root/devices.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2023-11-04 00:03:42 +0000
committerjwansek <eddie.atten.ea29@gmail.com>2023-11-04 00:03:42 +0000
commita09c97c4182885d3f62735b45ebe76f5a3a9f8dd (patch)
tree76b1330a71c3ad8237d788c2e6fc78afa29e37c9 /devices.py
parent29eb6dd5be90204e9251eef942b7b994ff4d2423 (diff)
downloadpower.eda.gay-a09c97c4182885d3f62735b45ebe76f5a3a9f8dd.tar.gz
power.eda.gay-a09c97c4182885d3f62735b45ebe76f5a3a9f8dd.zip
Changed mikrotik interface to use SSH instead, worked on client side
Diffstat (limited to 'devices.py')
-rw-r--r--devices.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/devices.py b/devices.py
index 4193780..8ec9261 100644
--- a/devices.py
+++ b/devices.py
@@ -9,9 +9,7 @@ import os
if not os.path.exists(os.path.join("/app", ".docker")):
import dotenv
dotenv.load_dotenv(dotenv_path = "power.env")
- HOST = "srv.athome"
-else:
- HOST = None
+HOST = None
async def get_energy_for(host, username = None, password = None):
device = await tasmotadevicecontroller.TasmotaDevice().connect(host, username, password)
@@ -53,7 +51,7 @@ def poll_watt_all():
def poll_kwh_all():
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
- with database.PowerDatabase(host = HOST) as db:
+ with database.PowerDatabase() as db:
for host, username, password, description in db.get_tasmota_devices():
while True:
try: