From 0c423e3809a536b58998045f6da4dabeeb6d7df9 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 17 Jan 2022 16:38:43 +0100 Subject: [PATCH] FIX: SensorDataChangeEvent trigger logic The event should be skipped only if new_data is null or an empty, list/object, not if it contains a zero/false-y value. --- platypush/backend/sensor/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platypush/backend/sensor/__init__.py b/platypush/backend/sensor/__init__.py index 0cf5beb2f..7d4042e65 100644 --- a/platypush/backend/sensor/__init__.py +++ b/platypush/backend/sensor/__init__.py @@ -175,7 +175,7 @@ class SensorBackend(Backend): plugin.close() def process_data(self, data, new_data): - if new_data: + if new_data is not None and data not in ({}, []): self.bus.post(SensorDataChangeEvent(data=new_data, source=self.plugin or self.__class__.__name__)) def run(self):