From d781dc46005d36a3729f418eb4c2403c52357089 Mon Sep 17 00:00:00 2001 From: Charles Garwood Date: Wed, 14 Feb 2024 15:45:29 -0500 Subject: [PATCH] Add support for Fully Kiosk sound playing state (#105762) --- homeassistant/components/fully_kiosk/media_player.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/fully_kiosk/media_player.py b/homeassistant/components/fully_kiosk/media_player.py index 0984d6a220f..8e6d2fad533 100644 --- a/homeassistant/components/fully_kiosk/media_player.py +++ b/homeassistant/components/fully_kiosk/media_player.py @@ -12,7 +12,7 @@ from homeassistant.components.media_player import ( async_process_play_media_url, ) from homeassistant.config_entries import ConfigEntry -from homeassistant.core import HomeAssistant +from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.entity_platform import AddEntitiesCallback from .const import AUDIOMANAGER_STREAM_MUSIC, DOMAIN, MEDIA_SUPPORT_FULLYKIOSK @@ -82,3 +82,13 @@ class FullyMediaPlayer(FullyKioskEntity, MediaPlayerEntity): media_content_id, content_filter=lambda item: item.media_content_type.startswith("audio/"), ) + + @callback + def _handle_coordinator_update(self) -> None: + """Handle updated data from the coordinator.""" + self._attr_state = ( + MediaPlayerState.PLAYING + if "soundUrlPlaying" in self.coordinator.data + else MediaPlayerState.IDLE + ) + self.async_write_ha_state()