3 Commits
0.0.1 ... 0.0.4

Author SHA1 Message Date
5075af27d1 fix decoding 2023-06-02 20:51:05 +02:00
5427e3f277 fix typo 2023-06-02 20:39:09 +02:00
78c0f45cd7 avoid deployment at berresheim setup 2023-06-02 20:08:16 +02:00
2 changed files with 5 additions and 13 deletions

View File

@ -56,9 +56,3 @@ deploy-saerbeck:
environment:
name: saerbeck-production
deploy-berresheim:
extends: .deploy
tags:
- berresheim-deployment-only
environment:
name: berresheim-production

View File

@ -64,7 +64,7 @@ class DbOp(object):
with conn.cursor() as cur:
cur.execute("""
insert into measurement_t (time, application_name, moisture, temperature, conductivity, status, battery)
values (now(), %(application_name)s, %(moisture)s, %(temperature)s, %(conductivity), %(status)s, %(battery)s)
values (now(), %(application_name)s, %(moisture)s, %(temperature)s, %(conductivity)s, %(status)s, %(battery)s)
""",
{
'application_name': measurement['application_name'],
@ -107,15 +107,13 @@ def mqttOnMessageCallback(client, userdata, message):
match application['sensor_type']:
case 'LSE01':
battery = struct.unpack('>H', frame[0:2])[0]
moisture = struct.unpack('>H', frame[2:4])[0]
temperature = struct.unpack('>H', frame[4:6])[0]
conductivity = struct.unpack('>H', frame[6:8])[0]
status = struct.unpack('?', frame[8:9])[0]
moisture = struct.unpack('>H', frame[4:6])[0]
temperature = struct.unpack('>H', frame[6:8])[0]
conductivity = struct.unpack('>H', frame[8:10])[0]
status = struct.unpack('?', frame[10:11])[0]
logger.debug(f"{frame=}, {battery=}, {moisture=}, {temperature=}, {conductivity=}, {status=}")
statusText = 'Ok'
if not status:
statusText = 'No sensor'
measurement = {
'application_name': application['label'],