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:
Fabio Manganiello 2023-04-15 01:21:18 +02:00
parent 4c19535612
commit 74aeca5c34
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -135,7 +135,7 @@ class SensorPlugin(RunnablePlugin, SensorEntityManager, ABC):
else:
tolerance = 0
return abs(old_data - new_data) >= tolerance
return abs(old_data - new_data) > tolerance
def _has_changes(
self,