Add support for Fully Kiosk sound playing state (#105762)
parent
4627e8b1fc
commit
d781dc4600
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue