diff options
Diffstat (limited to 'scripts/neohub.py')
-rw-r--r-- | scripts/neohub.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/neohub.py b/scripts/neohub.py index e5c1b16..4fd3a16 100644 --- a/scripts/neohub.py +++ b/scripts/neohub.py @@ -46,4 +46,19 @@ async def run(): common.dbi(sql, values) + + sql = """INSERT INTO mqtt_temps + (name, + temperature, + time, + room) + SELECT 'neohub', %s, %s, sensors.room + FROM sensors + WHERE sensors.name = 'neohub'""" + values = (device.temperature, datetime.utcnow()) + + common.dbi(sql, values) + + + asyncio.run(run()) |