diff --git a/platypush/plugins/gpio/sensor/motion/pwm3901.py b/platypush/plugins/gpio/sensor/motion/pwm3901.py index 97ccb890..6398142c 100644 --- a/platypush/plugins/gpio/sensor/motion/pwm3901.py +++ b/platypush/plugins/gpio/sensor/motion/pwm3901.py @@ -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), }