From 43ceb1c6c8644fcbb771472d99b78e4967099ec0 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Wed, 29 May 2024 14:18:46 -0500 Subject: [PATCH] Handle case where timer device id exists but is not registered (delayed command) (#118410) Handle case where device id exists but is not registered --- homeassistant/components/intent/timers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/intent/timers.py b/homeassistant/components/intent/timers.py index 1dc6b279a61..cddfce55b9f 100644 --- a/homeassistant/components/intent/timers.py +++ b/homeassistant/components/intent/timers.py @@ -229,7 +229,9 @@ class TimerManager: if (not conversation_command) and (device_id is None): raise ValueError("Conversation command must be set if no device id") - if (device_id is not None) and (not self.is_timer_device(device_id)): + if (not conversation_command) and ( + (device_id is None) or (not self.is_timer_device(device_id)) + ): raise TimersNotSupportedError(device_id) total_seconds = 0 @@ -276,7 +278,7 @@ class TimerManager: name=f"Timer {timer_id}", ) - if timer.device_id is not None: + if timer.device_id in self.handlers: self.handlers[timer.device_id](TimerEventType.STARTED, timer) _LOGGER.debug( "Timer started: id=%s, name=%s, hours=%s, minutes=%s, seconds=%s, device_id=%s",