diff --git a/custom_components/remote_media_player/media_player.py b/custom_components/remote_media_player/media_player.py index fed627a..f8722f2 100644 --- a/custom_components/remote_media_player/media_player.py +++ b/custom_components/remote_media_player/media_player.py @@ -199,6 +199,10 @@ class MediaPlayerCoordinator(DataUpdateCoordinator[dict[str, Any]]): # Re-enable polling as fallback self.update_interval = timedelta(seconds=self._poll_interval) _LOGGER.warning("WebSocket disconnected, falling back to polling") + # Trigger an immediate refresh to restart the polling loop. + # Without this, the polling loop stays stopped (it was disabled when + # WebSocket was active) and the entity never becomes unavailable. + self.hass.async_create_task(self.async_request_refresh()) # Schedule reconnect attempt self._schedule_reconnect()