ui: downgrade assertion on missing notification flag to warning

This commit is contained in:
Peter F. Patel-Schneider 2024-01-30 08:00:25 -05:00
parent 86fa3757f3
commit 28493f7496
1 changed files with 6 additions and 2 deletions

View File

@ -90,8 +90,12 @@ class ReceiverListener(_listener.EventsListener):
if _log.isEnabledFor(_INFO): if _log.isEnabledFor(_INFO):
_log.info('%s: notifications listener has started (%s)', self.receiver, self.receiver.handle) _log.info('%s: notifications listener has started (%s)', self.receiver, self.receiver.handle)
nfs = self.receiver.enable_connection_notifications() nfs = self.receiver.enable_connection_notifications()
assert self.receiver.isDevice or ((nfs if nfs else 0) & _hidpp10.NOTIFICATION_FLAG.wireless), \ if _log.isEnabledFor(_WARNING):
'Receiver on %s does not support connection notifications, GUI will not show it' % self.receiver.path if not self.receiver.isDevice and not ((nfs if nfs else 0) & _hidpp10.NOTIFICATION_FLAG.wireless):
_log.warning(
'Receiver on %s might not support connection notifications, GUI might not show its devices',
self.receiver.path
)
self.receiver.status[_status.KEYS.NOTIFICATION_FLAGS] = nfs self.receiver.status[_status.KEYS.NOTIFICATION_FLAGS] = nfs
self.receiver.notify_devices() self.receiver.notify_devices()
self._status_changed(self.receiver) # , _status.ALERT.NOTIFICATION) self._status_changed(self.receiver) # , _status.ALERT.NOTIFICATION)