Add support for Fully Kiosk sound playing state (#105762)

pull/110572/head^2
Charles Garwood 2024-02-14 15:45:29 -05:00 committed by GitHub
parent 4627e8b1fc
commit d781dc4600
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 1 deletions

View File

@ -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()