Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.timer.Timer Class Reference
Inheritance diagram for homeassistant.components.timer.Timer:
[legend]
Collaboration diagram for homeassistant.components.timer.Timer:
[legend]

Public Member Functions

None __init__ (self, ConfigType config)
 
None async_added_to_hass (self)
 
None async_cancel (self)
 
None async_change (self, timedelta duration)
 
None async_finish (self)
 
None async_pause (self)
 
None async_start (self, timedelta|None duration=None)
 
None async_update_config (self, ConfigType config)
 
dict[str, Any] extra_state_attributes (self)
 
Self from_storage (cls, ConfigType config)
 
Self from_yaml (cls, ConfigType config)
 
str|None icon (self)
 
str|None name (self)
 
str state (self)
 
str|None unique_id (self)
 
- Public Member Functions inherited from homeassistant.helpers.restore_state.RestoreEntity
ExtraStoredData|None async_get_last_extra_data (self)
 
State|None async_get_last_state (self)
 
None async_internal_added_to_hass (self)
 
None async_internal_will_remove_from_hass (self)
 
ExtraStoredData|None extra_restore_state_data (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_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_will_remove_from_hass (self)
 
None async_write_ha_state (self)
 
str|None attribution (self)
 
bool available (self)
 
dict[str, Any]|None capability_attributes (self)
 
str|None device_class (self)
 
DeviceInfo|None device_info (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)
 
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 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

None _async_finished (self, datetime time)
 

Private Attributes

 _attr_force_update
 
 _attr_should_poll
 
 _config
 
 _configured_duration
 
 _end
 
 _listener
 
 _remaining
 
 _restore
 
 _running_duration
 
 _state
 

Additional Inherited Members

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

Detailed Description

Representation of a timer.

Definition at line 200 of file __init__.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.timer.Timer.__init__ (   self,
ConfigType  config 
)
Initialize a timer.

Definition at line 205 of file __init__.py.

Member Function Documentation

◆ _async_finished()

None homeassistant.components.timer.Timer._async_finished (   self,
datetime  time 
)
private
Reset and updates the states, fire finished event.

Definition at line 411 of file __init__.py.

◆ async_added_to_hass()

None homeassistant.components.timer.Timer.async_added_to_hass (   self)
Call when entity is about to be added to Home Assistant.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 270 of file __init__.py.

◆ async_cancel()

None homeassistant.components.timer.Timer.async_cancel (   self)
Cancel a timer.

Definition at line 376 of file __init__.py.

◆ async_change()

None homeassistant.components.timer.Timer.async_change (   self,
timedelta  duration 
)
Change duration of a running timer.

Definition at line 335 of file __init__.py.

◆ async_finish()

None homeassistant.components.timer.Timer.async_finish (   self)
Reset and updates the states, fire finished event.

Definition at line 391 of file __init__.py.

◆ async_pause()

None homeassistant.components.timer.Timer.async_pause (   self)
Pause a timer.

Definition at line 362 of file __init__.py.

◆ async_start()

None homeassistant.components.timer.Timer.async_start (   self,
timedelta | None   duration = None 
)
Start a timer.

Definition at line 306 of file __init__.py.

◆ async_update_config()

None homeassistant.components.timer.Timer.async_update_config (   self,
ConfigType  config 
)
Handle when the config is updated.

Definition at line 428 of file __init__.py.

◆ extra_state_attributes()

dict[str, Any] homeassistant.components.timer.Timer.extra_state_attributes (   self)
Return the state attributes.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 250 of file __init__.py.

◆ from_storage()

Self homeassistant.components.timer.Timer.from_storage (   cls,
ConfigType  config 
)
Return entity instance initialized from storage.

Definition at line 220 of file __init__.py.

◆ from_yaml()

Self homeassistant.components.timer.Timer.from_yaml (   cls,
ConfigType  config 
)
Return entity instance initialized from yaml.

Definition at line 227 of file __init__.py.

◆ icon()

str | None homeassistant.components.timer.Timer.icon (   self)
Return the icon to be used for this entity.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 240 of file __init__.py.

◆ name()

str | None homeassistant.components.timer.Timer.name (   self)
Return name of the timer.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 235 of file __init__.py.

◆ state()

str homeassistant.components.timer.Timer.state (   self)
Return the current value of the timer.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 245 of file __init__.py.

◆ unique_id()

str | None homeassistant.components.timer.Timer.unique_id (   self)
Return unique id for the entity.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 266 of file __init__.py.

Member Data Documentation

◆ _attr_force_update

homeassistant.components.timer.Timer._attr_force_update
private

Definition at line 217 of file __init__.py.

◆ _attr_should_poll

homeassistant.components.timer.Timer._attr_should_poll
private

Definition at line 216 of file __init__.py.

◆ _config

homeassistant.components.timer.Timer._config
private

Definition at line 430 of file __init__.py.

◆ _configured_duration

homeassistant.components.timer.Timer._configured_duration
private

Definition at line 209 of file __init__.py.

◆ _end

homeassistant.components.timer.Timer._end
private

Definition at line 302 of file __init__.py.

◆ _listener

homeassistant.components.timer.Timer._listener
private

Definition at line 310 of file __init__.py.

◆ _remaining

homeassistant.components.timer.Timer._remaining
private

Definition at line 288 of file __init__.py.

◆ _restore

homeassistant.components.timer.Timer._restore
private

Definition at line 434 of file __init__.py.

◆ _running_duration

homeassistant.components.timer.Timer._running_duration
private

Definition at line 285 of file __init__.py.

◆ _state

homeassistant.components.timer.Timer._state
private

Definition at line 275 of file __init__.py.


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