Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.songpal.media_player.SongpalEntity Class Reference
Inheritance diagram for homeassistant.components.songpal.media_player.SongpalEntity:
[legend]
Collaboration diagram for homeassistant.components.songpal.media_player.SongpalEntity:
[legend]

Public Member Functions

def __init__ (self, name, device)
 
def async_activate_websocket (self)
 
None async_added_to_hass (self)
 
None async_mute_volume (self, bool mute)
 
None async_select_sound_mode (self, str sound_mode)
 
None async_select_source (self, str source)
 
def async_set_sound_setting (self, name, value)
 
None async_set_volume_level (self, float volume)
 
None async_turn_off (self)
 
None async_turn_on (self)
 
None async_update (self)
 
None async_volume_down (self)
 
None async_volume_up (self)
 
None async_will_remove_from_hass (self)
 
DeviceInfo device_info (self)
 
str|None sound_mode (self)
 
list[str]|None sound_mode_list (self)
 
def source (self)
 
def source_list (self)
 
MediaPlayerState state (self)
 
def unique_id (self)
 
def volume_level (self)
 
- Public Member Functions inherited from homeassistant.components.media_player.MediaPlayerEntity
str access_token (self)
 
str|None app_id (self)
 
str|None app_name (self)
 
BrowseMedia async_browse_media (self, MediaType|str|None media_content_type=None, str|None media_content_id=None)
 
None async_clear_playlist (self)
 
tuple[bytes|None, str|Noneasync_get_browse_image (self, str media_content_type, str media_content_id, str|None media_image_id=None)
 
tuple[bytes|None, str|Noneasync_get_media_image (self)
 
None async_join_players (self, list[str] group_members)
 
None async_media_next_track (self)
 
None async_media_pause (self)
 
None async_media_play (self)
 
None async_media_play_pause (self)
 
None async_media_previous_track (self)
 
None async_media_seek (self, float position)
 
None async_media_stop (self)
 
None async_play_media (self, MediaType|str media_type, str media_id, **Any kwargs)
 
None async_set_repeat (self, RepeatMode repeat)
 
None async_set_shuffle (self, bool shuffle)
 
None async_toggle (self)
 
None async_unjoin_player (self)
 
dict[str, Any] capability_attributes (self)
 
None clear_playlist (self)
 
MediaPlayerDeviceClass|None device_class (self)
 
str|None entity_picture (self)
 
str get_browse_image_url (self, str media_content_type, str media_content_id, str|None media_image_id=None)
 
list[str]|None group_members (self)
 
bool|None is_volume_muted (self)
 
None join_players (self, list[str] group_members)
 
str|None media_album_artist (self)
 
str|None media_album_name (self)
 
str|None media_artist (self)
 
str|None media_channel (self)
 
str|None media_content_id (self)
 
MediaType|str|None media_content_type (self)
 
int|None media_duration (self)
 
str|None media_episode (self)
 
str|None media_image_hash (self)
 
str|None media_image_local (self)
 
bool media_image_remotely_accessible (self)
 
str|None media_image_url (self)
 
None media_next_track (self)
 
None media_pause (self)
 
None media_play (self)
 
str|None media_playlist (self)
 
int|None media_position (self)
 
dt.datetime|None media_position_updated_at (self)
 
None media_previous_track (self)
 
str|None media_season (self)
 
None media_seek (self, float position)
 
str|None media_series_title (self)
 
None media_stop (self)
 
str|None media_title (self)
 
int|None media_track (self)
 
None mute_volume (self, bool mute)
 
None play_media (self, MediaType|str media_type, str media_id, **Any kwargs)
 
RepeatMode|str|None repeat (self)
 
None select_sound_mode (self, str sound_mode)
 
None select_source (self, str source)
 
None set_repeat (self, RepeatMode repeat)
 
None set_shuffle (self, bool shuffle)
 
None set_volume_level (self, float volume)
 
bool|None shuffle (self)
 
dict[str, Any] state_attributes (self)
 
bool support_clear_playlist (self)
 
bool support_grouping (self)
 
bool support_next_track (self)
 
bool support_pause (self)
 
bool support_play (self)
 
bool support_play_media (self)
 
bool support_previous_track (self)
 
bool support_seek (self)
 
bool support_select_sound_mode (self)
 
bool support_select_source (self)
 
bool support_shuffle_set (self)
 
bool support_stop (self)
 
bool support_volume_mute (self)
 
bool support_volume_set (self)
 
MediaPlayerEntityFeature supported_features (self)
 
MediaPlayerEntityFeature supported_features_compat (self)
 
None turn_off (self)
 
None turn_on (self)
 
None unjoin_player (self)
 
float volume_step (self)
 
- Public Member Functions inherited from homeassistant.helpers.entity.Entity
None __init_subclass__ (cls, **Any kwargs)
 
str __repr__ (self)
 
None add_to_platform_abort (self)
 
None add_to_platform_finish (self)
 
None add_to_platform_start (self, HomeAssistant hass, EntityPlatform platform, asyncio.Semaphore|None parallel_updates)
 
bool assumed_state (self)
 
None async_device_update (self, bool warning=True)
 
None async_internal_added_to_hass (self)
 
None async_internal_will_remove_from_hass (self)
 
None async_on_remove (self, CALLBACK_TYPE func)
 
None async_registry_entry_updated (self)
 
None async_remove (self, *bool force_remove=False)
 
None async_removed_from_registry (self)
 
None async_schedule_update_ha_state (self, bool force_refresh=False)
 
None async_set_context (self, Context context)
 
None async_update_ha_state (self, bool force_refresh=False)
 
None async_write_ha_state (self)
 
str|None attribution (self)
 
bool available (self)
 
bool enabled (self)
 
EntityCategory|None entity_category (self)
 
bool entity_registry_enabled_default (self)
 
bool entity_registry_visible_default (self)
 
Mapping[str, Any]|None extra_state_attributes (self)
 
bool force_update (self)
 
HassJobType get_hassjob_type (self, str function_name)
 
er.EntityOptionsType|None get_initial_entity_options (self)
 
bool has_entity_name (self)
 
str|None icon (self)
 
str|UndefinedType|None name (self)
 
None schedule_update_ha_state (self, bool force_refresh=False)
 
bool should_poll (self)
 
str|None suggested_object_id (self)
 
str|None translation_key (self)
 
Mapping[str, strtranslation_placeholders (self)
 
str|None unit_of_measurement (self)
 
bool use_device_name (self)
 
- Public Member Functions inherited from homeassistant.helpers.entity.CachedProperties
None __init__ (cls, str name, tuple[type,...] bases, dict[Any, Any] namespace, **Any kwargs)
 
Any __new__ (mcs, str name, tuple[type,...] bases, dict[Any, Any] namespace, set[str]|None cached_properties=None, **Any kwargs)
 

Private Member Functions

def _get_sound_modes_info (self)
 

Private Attributes

 _active_sound_mode
 
 _active_source
 
 _attr_available
 
 _attr_is_volume_muted
 
 _dev
 
 _initialized
 
 _model
 
 _name
 
 _sound_modes
 
 _sources
 
 _state
 
 _sysinfo
 
 _volume
 
 _volume_control
 
 _volume_max
 
 _volume_min
 

Static Private Attributes

 _attr_device_class = MediaPlayerDeviceClass.RECEIVER
 
bool _attr_has_entity_name = True
 
 _attr_name = None
 
bool _attr_should_poll = False
 
tuple _attr_supported_features
 

Additional Inherited Members

- Public Attributes inherited from homeassistant.components.media_player.MediaPlayerEntity
 state
 
- Public Attributes inherited from homeassistant.helpers.entity.Entity
 device_entry
 
 entity_id
 
 hass
 
 parallel_updates
 
 platform
 
 registry_entry
 
- Static Public Attributes inherited from homeassistant.components.media_player.MediaPlayerEntity
 bool
 
 MediaPlayerEntityFeature
 
 None
 
- Static Public Attributes inherited from homeassistant.helpers.entity.Entity
 bool
 
 EntityPlatform
 
 HomeAssistant
 
 None
 
 StateInfo
 
 StateType
 
 str
 

Detailed Description

Class representing a Songpal device.

Definition at line 94 of file media_player.py.

Constructor & Destructor Documentation

◆ __init__()

def homeassistant.components.songpal.media_player.SongpalEntity.__init__ (   self,
  name,
  device 
)
Init.

Definition at line 111 of file media_player.py.

Member Function Documentation

◆ _get_sound_modes_info()

def homeassistant.components.songpal.media_player.SongpalEntity._get_sound_modes_info (   self)
private
Get available sound modes and the active one.

Definition at line 141 of file media_player.py.

◆ async_activate_websocket()

def homeassistant.components.songpal.media_player.SongpalEntity.async_activate_websocket (   self)
Activate websocket for listening if wanted.

Definition at line 168 of file media_player.py.

◆ async_added_to_hass()

None homeassistant.components.songpal.media_player.SongpalEntity.async_added_to_hass (   self)
Run when entity is added to hass.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 133 of file media_player.py.

◆ async_mute_volume()

None homeassistant.components.songpal.media_player.SongpalEntity.async_mute_volume (   self,
bool  mute 
)
Mute or unmute the device.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 425 of file media_player.py.

◆ async_select_sound_mode()

None homeassistant.components.songpal.media_player.SongpalEntity.async_select_sound_mode (   self,
str  sound_mode 
)
Select sound mode.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 342 of file media_player.py.

◆ async_select_source()

None homeassistant.components.songpal.media_player.SongpalEntity.async_select_source (   self,
str  source 
)
Select source.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 328 of file media_player.py.

◆ async_set_sound_setting()

def homeassistant.components.songpal.media_player.SongpalEntity.async_set_sound_setting (   self,
  name,
  value 
)
Change a setting on the device.

Definition at line 269 of file media_player.py.

◆ async_set_volume_level()

None homeassistant.components.songpal.media_player.SongpalEntity.async_set_volume_level (   self,
float  volume 
)
Set volume level.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 387 of file media_player.py.

◆ async_turn_off()

None homeassistant.components.songpal.media_player.SongpalEntity.async_turn_off (   self)
Turn the device off.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 413 of file media_player.py.

◆ async_turn_on()

None homeassistant.components.songpal.media_player.SongpalEntity.async_turn_on (   self)
Turn the device on.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 401 of file media_player.py.

◆ async_update()

None homeassistant.components.songpal.media_player.SongpalEntity.async_update (   self)
Fetch updates from the device.

Definition at line 274 of file media_player.py.

◆ async_volume_down()

None homeassistant.components.songpal.media_player.SongpalEntity.async_volume_down (   self)
Set volume down.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 397 of file media_player.py.

◆ async_volume_up()

None homeassistant.components.songpal.media_player.SongpalEntity.async_volume_up (   self)
Set volume up.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 393 of file media_player.py.

◆ async_will_remove_from_hass()

None homeassistant.components.songpal.media_player.SongpalEntity.async_will_remove_from_hass (   self)
Run when entity will be removed from hass.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 137 of file media_player.py.

◆ device_info()

DeviceInfo homeassistant.components.songpal.media_player.SongpalEntity.device_info (   self)
Return the device info.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 253 of file media_player.py.

◆ sound_mode()

str | None homeassistant.components.songpal.media_player.SongpalEntity.sound_mode (   self)
Return currently active sound_mode.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 377 of file media_player.py.

◆ sound_mode_list()

list[str] | None homeassistant.components.songpal.media_player.SongpalEntity.sound_mode_list (   self)
Return list of available sound modes.

When active mode is None it means that sound mode is unavailable on the sound bar.
Can be due to incompatible sound bar or the sound bar is in a mode that does not
support sound mode changes.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 352 of file media_player.py.

◆ source()

def homeassistant.components.songpal.media_player.SongpalEntity.source (   self)
Return currently active source.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 371 of file media_player.py.

◆ source_list()

def homeassistant.components.songpal.media_player.SongpalEntity.source_list (   self)
Return list of available sources.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 338 of file media_player.py.

◆ state()

MediaPlayerState homeassistant.components.songpal.media_player.SongpalEntity.state (   self)
Return current state.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 364 of file media_player.py.

◆ unique_id()

def homeassistant.components.songpal.media_player.SongpalEntity.unique_id (   self)
Return a unique ID.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 248 of file media_player.py.

◆ volume_level()

def homeassistant.components.songpal.media_player.SongpalEntity.volume_level (   self)
Return volume level.

Reimplemented from homeassistant.components.media_player.MediaPlayerEntity.

Definition at line 383 of file media_player.py.

Member Data Documentation

◆ _active_sound_mode

homeassistant.components.songpal.media_player.SongpalEntity._active_sound_mode
private

Definition at line 130 of file media_player.py.

◆ _active_source

homeassistant.components.songpal.media_player.SongpalEntity._active_source
private

Definition at line 128 of file media_player.py.

◆ _attr_available

homeassistant.components.songpal.media_player.SongpalEntity._attr_available
private

Definition at line 119 of file media_player.py.

◆ _attr_device_class

homeassistant.components.songpal.media_player.SongpalEntity._attr_device_class = MediaPlayerDeviceClass.RECEIVER
staticprivate

Definition at line 98 of file media_player.py.

◆ _attr_has_entity_name

bool homeassistant.components.songpal.media_player.SongpalEntity._attr_has_entity_name = True
staticprivate

Definition at line 108 of file media_player.py.

◆ _attr_is_volume_muted

homeassistant.components.songpal.media_player.SongpalEntity._attr_is_volume_muted
private

Definition at line 126 of file media_player.py.

◆ _attr_name

homeassistant.components.songpal.media_player.SongpalEntity._attr_name = None
staticprivate

Definition at line 109 of file media_player.py.

◆ _attr_should_poll

bool homeassistant.components.songpal.media_player.SongpalEntity._attr_should_poll = False
staticprivate

Definition at line 97 of file media_player.py.

◆ _attr_supported_features

tuple homeassistant.components.songpal.media_player.SongpalEntity._attr_supported_features
staticprivate
Initial value:
= (
MediaPlayerEntityFeature.VOLUME_SET
| MediaPlayerEntityFeature.VOLUME_STEP
| MediaPlayerEntityFeature.VOLUME_MUTE
| MediaPlayerEntityFeature.SELECT_SOURCE
| MediaPlayerEntityFeature.SELECT_SOUND_MODE
| MediaPlayerEntityFeature.TURN_ON
| MediaPlayerEntityFeature.TURN_OFF
)

Definition at line 99 of file media_player.py.

◆ _dev

homeassistant.components.songpal.media_player.SongpalEntity._dev
private

Definition at line 114 of file media_player.py.

◆ _initialized

homeassistant.components.songpal.media_player.SongpalEntity._initialized
private

Definition at line 120 of file media_player.py.

◆ _model

homeassistant.components.songpal.media_player.SongpalEntity._model
private

Definition at line 116 of file media_player.py.

◆ _name

homeassistant.components.songpal.media_player.SongpalEntity._name
private

Definition at line 113 of file media_player.py.

◆ _sound_modes

homeassistant.components.songpal.media_player.SongpalEntity._sound_modes
private

Definition at line 131 of file media_player.py.

◆ _sources

homeassistant.components.songpal.media_player.SongpalEntity._sources
private

Definition at line 129 of file media_player.py.

◆ _state

homeassistant.components.songpal.media_player.SongpalEntity._state
private

Definition at line 118 of file media_player.py.

◆ _sysinfo

homeassistant.components.songpal.media_player.SongpalEntity._sysinfo
private

Definition at line 115 of file media_player.py.

◆ _volume

homeassistant.components.songpal.media_player.SongpalEntity._volume
private

Definition at line 125 of file media_player.py.

◆ _volume_control

homeassistant.components.songpal.media_player.SongpalEntity._volume_control
private

Definition at line 122 of file media_player.py.

◆ _volume_max

homeassistant.components.songpal.media_player.SongpalEntity._volume_max
private

Definition at line 124 of file media_player.py.

◆ _volume_min

homeassistant.components.songpal.media_player.SongpalEntity._volume_min
private

Definition at line 123 of file media_player.py.


The documentation for this class was generated from the following file: