|
@@ -39,7 +39,7 @@ try:
|
39
|
39
|
except ImportError:
|
40
|
40
|
ROOT_LOGGER_NAME = 'root'
|
41
|
41
|
|
42
|
|
-BATTERY_WARN_LEVEL = 5
|
|
42
|
+BATTERY_WARN_LEVEL = 10
|
43
|
43
|
|
44
|
44
|
|
45
|
45
|
class warning(dict):
|
|
@@ -253,7 +253,7 @@ class shelly(base):
|
253
|
253
|
# WARNING CALL
|
254
|
254
|
#
|
255
|
255
|
def __warning__(self, client, key, data):
|
256
|
|
- w = warning(self.topic, warning.TYPE_OVERTEMPERATURE, "Temperature to high (%.1f°C)", self.get(self.KEY_TEMPERATURE, math.nan))
|
|
256
|
+ w = warning(self.topic, warning.TYPE_OVERTEMPERATURE, "Temperature to high (%.1f°C)", self.get(self.KEY_TEMPERATURE) or math.nan)
|
257
|
257
|
self.logger.warning(w)
|
258
|
258
|
self.set(self.KEY_WARNING, w)
|
259
|
259
|
|
|
@@ -407,7 +407,7 @@ class silvercrest_motion_sensor(base):
|
407
|
407
|
# WARNING CALL
|
408
|
408
|
#
|
409
|
409
|
def __warning__(self, client, key, data):
|
410
|
|
- w = warning(self.topic, warning.TYPE_BATTERY_LOW, "Battery low (%.1f%%)", self.get(self.KEY_BATTERY, math.nan))
|
|
410
|
+ w = warning(self.topic, warning.TYPE_BATTERY_LOW, "Battery low (%.1f%%)", self.get(self.KEY_BATTERY) or math.nan)
|
411
|
411
|
self.logger.warning(w)
|
412
|
412
|
self.set(self.KEY_WARNING, w)
|
413
|
413
|
|