1 Commits
0.0.3 ... 0.0.4

Author SHA1 Message Date
5075af27d1 fix decoding 2023-06-02 20:51:05 +02:00

View File

@ -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'],