forked from platypush/platypush
Trigger a sensor event only if abs(old_data - new_data) > tolerance
Not if abs(old_data - new_data) >= tolerance, otherwise events will always be triggered when tolerance=0, even if the data hasn't changed.
This commit is contained in:
parent
4c19535612
commit
74aeca5c34
1 changed files with 1 additions and 1 deletions
|
@ -135,7 +135,7 @@ class SensorPlugin(RunnablePlugin, SensorEntityManager, ABC):
|
||||||
else:
|
else:
|
||||||
tolerance = 0
|
tolerance = 0
|
||||||
|
|
||||||
return abs(old_data - new_data) >= tolerance
|
return abs(old_data - new_data) > tolerance
|
||||||
|
|
||||||
def _has_changes(
|
def _has_changes(
|
||||||
self,
|
self,
|
||||||
|
|
Loading…
Reference in a new issue