Переглянути джерело

2024-03-19:
- support LaCrosse-ID value 0

FloKra 8 місяців тому
батько
коміт
ea1f2dec29
2 змінених файлів з 6 додано та 2 видалено
  1. 3 0
      CHANGELOG.md
  2. 3 2
      jeelinklog/jeelinklog.py

+ 3 - 0
CHANGELOG.md

@@ -1,5 +1,8 @@
 # JeeLinkLogMQTT - change log
 
+## 2024-03-19
+* support LaCrosse-ID value 0
+
 ## 2023-11-30
 * add LaCrosse/lastUpdate MQTT output for monitoring purposes, updates every time any sensor data is received
 

+ 3 - 2
jeelinklog/jeelinklog.py

@@ -236,7 +236,8 @@ for key in sensors_yaml:
     #print(key, '->', sensors_yaml[key])
     if verbosemode: print("Sensor name:", key)
     sensorName = key
-    if sensors_yaml[key].get('LaCrosseID'):
+    
+    if sensors_yaml[key].get('LaCrosseID') >= 0:
         if verbosemode: print("LaCrosseID:", sensors_yaml[key].get('LaCrosseID'))
         sensorId = sensors_yaml[key].get('LaCrosseID')
         sensors_id_to_name[sensorId] = sensorName
@@ -1151,7 +1152,7 @@ try:
                 #print(key, '->', sensors_yaml[key])
                 #print("Sensor name:", key)
                 sensorId = sensors_yaml[key].get('LaCrosseID', None)
-                if sensorId is not None:
+                if sensorId >= 0:
                     lupd = sensors_lastUpdate.get(sensorId, None)
                     tdiff = 0
                     if lupd is not None: