mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00:00
Log events with no listeners (#98540)
* Log events with no listeners * Unconditionally create the Event object * Reformat code
This commit is contained in:
parent
b9203cbeaf
commit
31f5932fe4
@ -1025,6 +1025,11 @@ class EventBus:
|
||||
listeners = self._listeners.get(event_type, [])
|
||||
match_all_listeners = self._match_all_listeners
|
||||
|
||||
event = Event(event_type, event_data, origin, time_fired, context)
|
||||
|
||||
if _LOGGER.isEnabledFor(logging.DEBUG):
|
||||
_LOGGER.debug("Bus:Handling %s", event)
|
||||
|
||||
if not listeners and not match_all_listeners:
|
||||
return
|
||||
|
||||
@ -1032,11 +1037,6 @@ class EventBus:
|
||||
if event_type != EVENT_HOMEASSISTANT_CLOSE:
|
||||
listeners = match_all_listeners + listeners
|
||||
|
||||
event = Event(event_type, event_data, origin, time_fired, context)
|
||||
|
||||
if _LOGGER.isEnabledFor(logging.DEBUG):
|
||||
_LOGGER.debug("Bus:Handling %s", event)
|
||||
|
||||
for job, event_filter, run_immediately in listeners:
|
||||
if event_filter is not None:
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user