Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Fully Kiosk sound playing state #105762

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()