1 """Entity representing a Bang & Olufsen device."""
3 from __future__
import annotations
5 from typing
import cast
7 from mozart_api.models
import (
8 PlaybackContentMetadata,
16 from mozart_api.mozart_client
import MozartClient
24 from .const
import DOMAIN
28 """Base class for BangOlufsen Home Assistant objects."""
30 def __init__(self, entry: ConfigEntry, client: MozartClient) ->
None:
31 """Initialize the object."""
37 self.entry: ConfigEntry = entry
40 self._host: str = self.entry.data[CONF_HOST]
41 self._unique_id: str = cast(str, self.entry.unique_id)
44 self._playback_metadata: PlaybackContentMetadata = PlaybackContentMetadata()
45 self._playback_progress: PlaybackProgress = PlaybackProgress(total_duration=0)
46 self._playback_source: Source = Source()
47 self._playback_state: RenderingState = RenderingState()
48 self._source_change: Source = Source()
49 self._volume: VolumeState = VolumeState(
50 level=VolumeLevel(level=0), muted=VolumeMute(muted=
False)
55 """Base Entity for BangOlufsen entities."""
57 _attr_has_entity_name =
True
58 _attr_should_poll =
False
60 def __init__(self, entry: ConfigEntry, client: MozartClient) ->
None:
61 """Initialize the object."""
68 """Update entity connection state."""
None __init__(self, ConfigEntry entry, MozartClient client)
None __init__(self, ConfigEntry entry, MozartClient client)
None _async_update_connection_state(self, bool connection_state)
None async_write_ha_state(self)