Add additional calendar state alarm debugging (#101631)
This commit is contained in:
parent
faea3b1634
commit
0f4aae4128
1 changed files with 4 additions and 1 deletions
|
@ -528,7 +528,9 @@ class CalendarEntity(Entity):
|
|||
the current or upcoming event.
|
||||
"""
|
||||
super().async_write_ha_state()
|
||||
|
||||
_LOGGER.debug(
|
||||
"Clearing %s alarms (%s)", self.entity_id, len(self._alarm_unsubs)
|
||||
)
|
||||
for unsub in self._alarm_unsubs:
|
||||
unsub()
|
||||
self._alarm_unsubs.clear()
|
||||
|
@ -536,6 +538,7 @@ class CalendarEntity(Entity):
|
|||
now = dt_util.now()
|
||||
event = self.event
|
||||
if event is None or now >= event.end_datetime_local:
|
||||
_LOGGER.debug("No alarms needed for %s (event=%s)", self.entity_id, event)
|
||||
return
|
||||
|
||||
@callback
|
||||
|
|
Loading…
Add table
Reference in a new issue