The network object isn't always available on a ZWave event

This commit is contained in:
Fabio Manganiello 2020-05-17 12:56:01 +02:00
parent aa66b81b7b
commit 51f99026ac

View file

@ -148,7 +148,7 @@ class ZwaveBackend(Backend):
def _process_event(self, event: _ZWEvent): def _process_event(self, event: _ZWEvent):
from platypush.plugins.zwave import ZwavePlugin from platypush.plugins.zwave import ZwavePlugin
network = event.network or self.network network = event.network if hasattr(event, 'network') and event.network else self.network
if event.signal == network.SIGNAL_NETWORK_STOPPED or \ if event.signal == network.SIGNAL_NETWORK_STOPPED or \
event.signal == network.SIGNAL_DRIVER_REMOVED: event.signal == network.SIGNAL_DRIVER_REMOVED: