1 """Timers for the mobile app."""
3 from datetime
import timedelta
11 from .
import device_action
18 event_type: TimerEventType,
19 timer_info: TimerInfo,
21 """Handle timer events."""
22 if event_type != TimerEventType.FINISHED:
26 message = f
"{timer_info.name} finished"
28 message = f
"{timedelta(seconds=timer_info.created_seconds)} timer finished"
30 entry.async_create_task(
32 device_action.async_call_action_from_config(
35 CONF_DEVICE_ID: timer_info.device_id,
36 notify.ATTR_MESSAGE: message,
46 "interruption-level":
"time-sensitive",
53 "mobile_app_timer_notification",
None async_handle_timer_event(HomeAssistant hass, ConfigEntry entry, TimerEventType event_type, TimerInfo timer_info)