forked from platypush/platypush
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.
This commit is contained in:
parent
6656bb4ce5
commit
0c423e3809
1 changed files with 1 additions and 1 deletions
|
@ -175,7 +175,7 @@ class SensorBackend(Backend):
|
||||||
plugin.close()
|
plugin.close()
|
||||||
|
|
||||||
def process_data(self, data, new_data):
|
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__))
|
self.bus.post(SensorDataChangeEvent(data=new_data, source=self.plugin or self.__class__.__name__))
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
Loading…
Reference in a new issue