listener: ignore many notifications that come to a device listener

This commit is contained in:
Peter F. Patel-Schneider 2021-10-27 12:56:08 -04:00
parent 7873f3e8d0
commit c1ce3c2c5f
1 changed files with 7 additions and 0 deletions

View File

@ -22,6 +22,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera
import time
from collections import namedtuple
from logging import DEBUG as _DEBUG
from logging import INFO as _INFO
from logging import WARNING as _WARNING
from logging import getLogger
@ -193,6 +194,12 @@ class ReceiverListener(_listener.EventsListener):
_notifications.process(self.receiver, n)
return
# a notification that came in to the device listener - strange, but nothing needs to be done here
if self.receiver.isDevice:
if _log.isEnabledFor(_DEBUG):
_log.debug('Notification %s via device %s being ignored.', n, self.receiver)
return
# a device notification
if not (0 < n.devnumber <= self.receiver.max_devices):
if _log.isEnabledFor(_WARNING):