From cd5a78bc94e7b338bff5f19f96add3dea4483856 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Mon, 3 Apr 2023 16:07:08 +0200 Subject: send mqtt and neohub to new states-table --- scripts/neohub.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'scripts/neohub.py') diff --git a/scripts/neohub.py b/scripts/neohub.py index 7ef8b77..f2c0ed8 100644 --- a/scripts/neohub.py +++ b/scripts/neohub.py @@ -47,17 +47,8 @@ async def call_neohub(): VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s)""" common.dbi(sql, values, verbose=True) + common.statein('neohub', device.temperature, 'temperature', '°C', verbose=True) - sql = """INSERT INTO mqtt_temps - (sensor_id, - temperature, - time) - SELECT sensors.id, %s, %s - FROM sensors - WHERE sensors.name = 'neohub'""" - values = (device.temperature, datetime.utcnow()) - - common.dbi(sql, values, verbose=True) # Loop it forever while True: -- cgit v1.2.3