Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.sonos.switch.SonosAlarmEntity Class Reference
Inheritance diagram for homeassistant.components.sonos.switch.SonosAlarmEntity:
[legend]
Collaboration diagram for homeassistant.components.sonos.switch.SonosAlarmEntity:
[legend]

Public Member Functions

None __init__ (self, str alarm_id, SonosSpeaker speaker)
 
Alarm alarm (self)
 
None async_added_to_hass (self)
 
bool async_check_if_available (self)
 
None async_update_state (self)
 
bool available (self)
 
dict[str, Any] extra_state_attributes (self)
 
bool is_on (self)
 
str name (self)
 
None turn_off (self, **Any kwargs)
 
None turn_on (self, **Any kwargs)
 
- Public Member Functions inherited from homeassistant.components.sonos.entity.SonosEntity
None __init__ (self, SonosSpeaker speaker)
 
None async_fallback_poll (self, datetime.datetime now)
 
None async_will_remove_from_hass (self)
 
DeviceInfo device_info (self)
 
SoCo soco (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)
 
dict[str, Any]|None capability_attributes (self)
 
bool enabled (self)
 
EntityCategory|None entity_category (self)
 
str|None entity_picture (self)
 
bool entity_registry_enabled_default (self)
 
bool entity_registry_visible_default (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)
 
None schedule_update_ha_state (self, bool force_refresh=False)
 
bool should_poll (self)
 
dict[str, Any]|None state_attributes (self)
 
str|None suggested_object_id (self)
 
int|None supported_features (self)
 
str|None translation_key (self)
 
Mapping[str, strtranslation_placeholders (self)
 
str|None unique_id (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)
 
- Public Member Functions inherited from homeassistant.components.switch.SwitchEntity
SwitchDeviceClass|None device_class (self)
 
- Public Member Functions inherited from homeassistant.helpers.entity.ToggleEntity
None async_toggle (self, **Any kwargs)
 
None async_turn_off (self, **Any kwargs)
 
None async_turn_on (self, **Any kwargs)
 
Literal["on", "off"]|None state (self)
 
None toggle (self, **Any kwargs)
 

Public Attributes

 alarm_id
 
 entity_id
 
 household_id
 
 speaker
 
- Public Attributes inherited from homeassistant.components.sonos.entity.SonosEntity
 speaker
 
- Public Attributes inherited from homeassistant.helpers.entity.Entity
 device_entry
 
 entity_id
 
 hass
 
 parallel_updates
 
 platform
 
 registry_entry
 

Private Member Functions

None _async_fallback_poll (self)
 
None _async_update_device (self)
 
None _handle_switch_on_off (self, bool turn_on)
 
bool _is_today (self)
 

Private Attributes

 _attr_unique_id
 

Static Private Attributes

 _attr_entity_category = EntityCategory.CONFIG
 
string _attr_icon = "mdi:alarm"
 

Additional Inherited Members

- Static Public Attributes inherited from homeassistant.helpers.entity.Entity
 bool
 
 EntityPlatform
 
 HomeAssistant
 
 None
 
 StateInfo
 
 StateType
 
 str
 
- Static Public Attributes inherited from homeassistant.helpers.entity.ToggleEntity
 None
 

Detailed Description

Representation of a Sonos Alarm entity.

Definition at line 182 of file switch.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.sonos.switch.SonosAlarmEntity.__init__ (   self,
str  alarm_id,
SonosSpeaker  speaker 
)
Initialize the switch.

Definition at line 188 of file switch.py.

Member Function Documentation

◆ _async_fallback_poll()

None homeassistant.components.sonos.switch.SonosAlarmEntity._async_fallback_poll (   self)
private
Call the central alarm polling method.

Reimplemented from homeassistant.components.sonos.entity.SonosEntity.

Definition at line 231 of file switch.py.

◆ _async_update_device()

None homeassistant.components.sonos.switch.SonosAlarmEntity._async_update_device (   self)
private
Update the device, since this alarm moved to a different player.

Definition at line 268 of file switch.py.

◆ _handle_switch_on_off()

None homeassistant.components.sonos.switch.SonosAlarmEntity._handle_switch_on_off (   self,
bool  turn_on 
)
private
Handle turn on/off of alarm switch.

Definition at line 333 of file switch.py.

◆ _is_today()

bool homeassistant.components.sonos.switch.SonosAlarmEntity._is_today (   self)
private
Return whether this alarm is scheduled for today.

Definition at line 289 of file switch.py.

◆ alarm()

Alarm homeassistant.components.sonos.switch.SonosAlarmEntity.alarm (   self)
Return the alarm instance.

Definition at line 219 of file switch.py.

◆ async_added_to_hass()

None homeassistant.components.sonos.switch.SonosAlarmEntity.async_added_to_hass (   self)
Handle switch setup when added to hass.

Reimplemented from homeassistant.components.sonos.entity.SonosEntity.

Definition at line 196 of file switch.py.

◆ async_check_if_available()

bool homeassistant.components.sonos.switch.SonosAlarmEntity.async_check_if_available (   self)
Check if alarm exists and remove alarm entity if not available.

Definition at line 236 of file switch.py.

◆ async_update_state()

None homeassistant.components.sonos.switch.SonosAlarmEntity.async_update_state (   self)
Poll the device for the current state.

Definition at line 249 of file switch.py.

◆ available()

bool homeassistant.components.sonos.switch.SonosAlarmEntity.available (   self)
Return whether this alarm is available.

Reimplemented from homeassistant.components.sonos.entity.SonosEntity.

Definition at line 301 of file switch.py.

◆ extra_state_attributes()

dict[str, Any] homeassistant.components.sonos.switch.SonosAlarmEntity.extra_state_attributes (   self)
Return attributes of Sonos alarm switch.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 311 of file switch.py.

◆ is_on()

bool homeassistant.components.sonos.switch.SonosAlarmEntity.is_on (   self)
Return state of Sonos alarm switch.

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Definition at line 306 of file switch.py.

◆ name()

str homeassistant.components.sonos.switch.SonosAlarmEntity.name (   self)
Return the name of the sensor.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 224 of file switch.py.

◆ turn_off()

None homeassistant.components.sonos.switch.SonosAlarmEntity.turn_off (   self,
**Any  kwargs 
)
Turn alarm switch off.

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Definition at line 328 of file switch.py.

◆ turn_on()

None homeassistant.components.sonos.switch.SonosAlarmEntity.turn_on (   self,
**Any  kwargs 
)
Turn alarm switch on.

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Definition at line 324 of file switch.py.

Member Data Documentation

◆ _attr_entity_category

homeassistant.components.sonos.switch.SonosAlarmEntity._attr_entity_category = EntityCategory.CONFIG
staticprivate

Definition at line 185 of file switch.py.

◆ _attr_icon

string homeassistant.components.sonos.switch.SonosAlarmEntity._attr_icon = "mdi:alarm"
staticprivate

Definition at line 186 of file switch.py.

◆ _attr_unique_id

homeassistant.components.sonos.switch.SonosAlarmEntity._attr_unique_id
private

Definition at line 191 of file switch.py.

◆ alarm_id

homeassistant.components.sonos.switch.SonosAlarmEntity.alarm_id

Definition at line 192 of file switch.py.

◆ entity_id

homeassistant.components.sonos.switch.SonosAlarmEntity.entity_id

Definition at line 194 of file switch.py.

◆ household_id

homeassistant.components.sonos.switch.SonosAlarmEntity.household_id

Definition at line 193 of file switch.py.

◆ speaker

homeassistant.components.sonos.switch.SonosAlarmEntity.speaker

Definition at line 255 of file switch.py.


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