From b1eab0da8b09397785692b1b0387e5157ad3d663 Mon Sep 17 00:00:00 2001 From: dennis Date: Mon, 6 Feb 2023 20:27:30 +0100 Subject: insert more temperatures --- scripts/neohub.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'scripts/neohub.py') 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()) -- cgit v1.2.3