diff options
author | dennis <d@ennis.no> | 2023-02-06 20:27:30 +0100 |
---|---|---|
committer | dennis <d@ennis.no> | 2023-02-06 20:27:30 +0100 |
commit | b1eab0da8b09397785692b1b0387e5157ad3d663 (patch) | |
tree | 2a4bcda4e38e57d06827484736e38ca431e3d36a /scripts/neohub.py | |
parent | remove extra whitespace (diff) | |
download | energyscripts-b1eab0da8b09397785692b1b0387e5157ad3d663.tar.gz |
insert more temperatures
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()) |