receiver: change notification before status setup from assertion to warning

This commit is contained in:
Peter F. Patel-Schneider 2020-08-09 15:41:43 -04:00
parent 78a6ae9208
commit 44f85d5dee
1 changed files with 6 additions and 3 deletions

View File

@ -237,9 +237,12 @@ class ReceiverListener(_listener.EventsListener):
# the receiver changed status as well
self._status_changed(self.receiver)
assert dev
assert dev.status is not None
_notifications.process(dev, n)
if dev.status is None:
# notification before device status set up - don't process it
_log.warn('%s before device %s has status', n, dev)
else:
_notifications.process(dev, n)
if self.receiver.status.lock_open and not already_known:
# this should be the first notification after a device was paired
assert n.sub_id == 0x41 and n.address == 0x04