diff --git a/homeassistant/components/usb/__init__.py b/homeassistant/components/usb/__init__.py index 959a8f5894c..48697c98ae7 100644 --- a/homeassistant/components/usb/__init__.py +++ b/homeassistant/components/usb/__init__.py @@ -207,8 +207,12 @@ class USBDiscovery: async def async_setup(self) -> None: """Set up USB Discovery.""" await self._async_start_monitor() - self.hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STARTED, self.async_start) - self.hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, self.async_stop) + self.hass.bus.async_listen_once( + EVENT_HOMEASSISTANT_STARTED, self.async_start, run_immediately=True + ) + self.hass.bus.async_listen_once( + EVENT_HOMEASSISTANT_STOP, self.async_stop, run_immediately=True + ) async def async_start(self, event: Event) -> None: """Start USB Discovery and run a manual scan.""" @@ -238,7 +242,9 @@ class USBDiscovery: def _stop_observer(event: Event) -> None: observer.stop() - self.hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _stop_observer) + self.hass.bus.async_listen_once( + EVENT_HOMEASSISTANT_STOP, _stop_observer, run_immediately=True + ) self.observer_active = True def _get_monitor_observer(self) -> MonitorObserver | None: