Don't fail hard if the seconds key is not in the map

This commit is contained in:
Fabio Manganiello 2019-09-24 01:20:14 +02:00
parent d21fd64100
commit 0fe255436e

View file

@ -114,7 +114,7 @@ class GpioSensorMotionPwm3901Plugin(GpioSensorPlugin):
'motion_x': x,
'motion_y': y,
'motion_mod': math.sqrt(x * x + y * y),
'motion_events_per_sec': self._events_per_sec[secs],
'motion_events_per_sec': self._events_per_sec.get(secs, 0),
}