forked from platypush/platypush
Shorter default poll_seconds (0.01) for better motion sensitivity
This commit is contained in:
parent
63d222d2ee
commit
3da6c41f21
1 changed files with 6 additions and 0 deletions
|
@ -11,6 +11,8 @@ class SensorMotionPwm3901Backend(SensorBackend):
|
|||
* ``pwm3901`` (``pip install pwm3901``)
|
||||
"""
|
||||
|
||||
_default_poll_seconds = 0.01
|
||||
|
||||
def __init__(self, absolute=True, relative=True, **kwargs):
|
||||
"""
|
||||
:param absolute: Enable absolute motion sensor events (default: true)
|
||||
|
@ -26,6 +28,10 @@ class SensorMotionPwm3901Backend(SensorBackend):
|
|||
'motion_abs_mod': absolute,
|
||||
}
|
||||
|
||||
if 'poll_seconds' not in kwargs:
|
||||
# noinspection PyTypeChecker
|
||||
kwargs['poll_seconds'] = self._default_poll_seconds
|
||||
|
||||
super().__init__(plugin='gpio.sensor.motion.pwm3901', enabled_sensors=enabled_sensors, **kwargs)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue