Fix bug in calendar state where alarms due to alarms not scheduled (#101510)

This commit is contained in:
Allen Porter 2023-10-06 00:19:21 -07:00 committed by GitHub
parent 244f6d8002
commit 579590f7c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -540,9 +540,9 @@ class CalendarEntity(Entity):
@callback @callback
def update(_: datetime.datetime) -> None: def update(_: datetime.datetime) -> None:
"""Run when the active or upcoming event starts or ends.""" """Update state and reschedule next alarms."""
_LOGGER.debug("Running %s update", self.entity_id) _LOGGER.debug("Running %s update", self.entity_id)
self._async_write_ha_state() self.async_write_ha_state()
if now < event.start_datetime_local: if now < event.start_datetime_local:
self._alarm_unsubs.append( self._alarm_unsubs.append(