Skip to content

Commit

Permalink
Add support for Fully Kiosk sound playing state (#105762)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgarwood authored Feb 14, 2024
1 parent 4627e8b commit d781dc4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion homeassistant/components/fully_kiosk/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
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
Expand Down Expand Up @@ -82,3 +82,13 @@ async def async_browse_media(
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()

0 comments on commit d781dc4

Please sign in to comment.