Home Assistant Unofficial Reference 2024.12.1
homeassistant.helpers.restore_state.RestoreEntity Class Reference

Inherits homeassistant.helpers.entity.Entity.

Inherited by homeassistant.components.august.lock.AugustLock, homeassistant.components.automation.AutomationEntity, homeassistant.components.broadlink.remote.BroadlinkRemote, homeassistant.components.broadlink.switch.BroadlinkSwitch, homeassistant.components.button.ButtonEntity, homeassistant.components.comelit.cover.ComelitCoverEntity, homeassistant.components.conversation.entity.ConversationEntity, homeassistant.components.counter.Counter, homeassistant.components.device_tracker.legacy.Device, homeassistant.components.dynalite.entity.DynaliteBase, homeassistant.components.elkm1.alarm_control_panel.ElkArea, homeassistant.components.event.EventEntity, homeassistant.components.ezviz.siren.EzvizSirenEntity, homeassistant.components.fireservicerota.sensor.IncidentsSensor, homeassistant.components.flux.switch.FluxSwitch, homeassistant.components.generic_hygrostat.humidifier.GenericHygrostat, homeassistant.components.generic_thermostat.climate.GenericThermostat, homeassistant.components.geofency.device_tracker.GeofencyEntity, homeassistant.components.gpslogger.device_tracker.GPSLoggerEntity, homeassistant.components.harmony.remote.HarmonyRemote, homeassistant.components.input_boolean.InputBoolean, homeassistant.components.input_button.InputButton, homeassistant.components.input_datetime.InputDatetime, homeassistant.components.input_number.InputNumber, homeassistant.components.input_select.InputSelect, homeassistant.components.input_text.InputText, homeassistant.components.iperf3.sensor.Iperf3Sensor, homeassistant.components.isy994.binary_sensor.ISYBinarySensorHeartbeat, homeassistant.components.isy994.light.ISYLightEntity, homeassistant.components.isy994.select.ISYBacklightSelectEntity, homeassistant.components.knx.binary_sensor.KNXBinarySensor, homeassistant.components.knx.date.KNXDateEntity, homeassistant.components.knx.datetime.KNXDateTimeEntity, homeassistant.components.knx.select.KNXSelect, homeassistant.components.knx.switch._KnxSwitch, homeassistant.components.knx.text.KNXText, homeassistant.components.knx.time.KNXTimeEntity, homeassistant.components.limitlessled.light.LimitlessLEDGroup, homeassistant.components.manual.alarm_control_panel.ManualAlarm, homeassistant.components.mobile_app.device_tracker.MobileAppEntity, homeassistant.components.mobile_app.entity.MobileAppEntity, homeassistant.components.modbus.binary_sensor.ModbusBinarySensor, homeassistant.components.modbus.binary_sensor.SlaveSensor, homeassistant.components.modbus.climate.ModbusThermostat, homeassistant.components.modbus.cover.ModbusCover, homeassistant.components.modbus.entity.BaseStructPlatform, homeassistant.components.modbus.entity.BaseSwitch, homeassistant.components.mqtt.binary_sensor.MqttBinarySensor, homeassistant.components.mqtt.lawn_mower.MqttLawnMower, homeassistant.components.mqtt.light.schema_basic.MqttLight, homeassistant.components.mqtt.light.schema_json.MqttLightJson, homeassistant.components.mqtt.light.schema_template.MqttLightTemplate, homeassistant.components.mqtt.select.MqttSelect, homeassistant.components.mqtt.switch.MqttSwitch, homeassistant.components.mqtt.update.MqttUpdate, homeassistant.components.notify.NotifyEntity, homeassistant.components.number.RestoreNumber, homeassistant.components.onvif.binary_sensor.ONVIFBinarySensor, homeassistant.components.owntracks.device_tracker.OwnTracksEntity, homeassistant.components.person.Person, homeassistant.components.pilight.entity.PilightBaseDevice, homeassistant.components.rflink.binary_sensor.RflinkBinarySensor, homeassistant.components.rflink.cover.RflinkCover, homeassistant.components.rflink.entity.SwitchableRflinkDevice, homeassistant.components.rfxtrx.entity.RfxtrxEntity, homeassistant.components.scene.Scene, homeassistant.components.screenlogic.climate.ScreenLogicClimate, homeassistant.components.script.ScriptEntity, homeassistant.components.shelly.binary_sensor.BlockSleepingBinarySensor, homeassistant.components.shelly.binary_sensor.RpcSleepingBinarySensor, homeassistant.components.shelly.climate.BlockSleepingClimate, homeassistant.components.shelly.switch.BlockSleepingMotionSwitch, homeassistant.components.shelly.update.RpcSleepingUpdateEntity, homeassistant.components.sia.entity.SIABaseEntity, homeassistant.components.smart_meter_texas.sensor.SmartMeterTexasSensor, homeassistant.components.snooz.fan.SnoozFan, homeassistant.components.somfy_mylink.cover.SomfyShade, homeassistant.components.starline.device_tracker.StarlineDeviceTracker, homeassistant.components.stt.SpeechToTextEntity, homeassistant.components.switchbot.cover.SwitchBotBlindTiltEntity, homeassistant.components.switchbot.cover.SwitchBotCurtainEntity, homeassistant.components.switchbot.switch.SwitchBotSwitch, homeassistant.components.template.alarm_control_panel.AlarmControlPanelTemplate, homeassistant.components.template.binary_sensor.BinarySensorTemplate, homeassistant.components.template.binary_sensor.TriggerBinarySensorEntity, homeassistant.components.template.switch.SwitchTemplate, homeassistant.components.template.weather.TriggerWeatherEntity, homeassistant.components.tesla_fleet.device_tracker.TeslaFleetDeviceTrackerEntity, homeassistant.components.text.RestoreText, homeassistant.components.timer.Timer, homeassistant.components.traccar.device_tracker.TraccarEntity, homeassistant.components.trend.binary_sensor.SensorTrend, homeassistant.components.tts.TextToSpeechEntity, homeassistant.components.unifiprotect.switch.ProtectPrivacyModeSwitch, homeassistant.components.update.UpdateEntity, homeassistant.components.utility_meter.select.TariffSelect, homeassistant.components.wake_word.WakeWordDetectionEntity, homeassistant.components.webostv.media_player.LgWebOSMediaPlayerEntity, homeassistant.components.xiaomi_aqara.binary_sensor.XiaomiDoorSensor, homeassistant.components.yale.lock.YaleLock, and homeassistant.components.zha.entity.ZHAEntity.

Collaboration diagram for homeassistant.helpers.restore_state.RestoreEntity:
[legend]

Public Member Functions

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_added_to_hass (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)
 
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)
 
StateType state (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)
 

Private Member Functions

StoredState|None _async_get_restored_data (self)
 

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

Mixin class for restoring previous entity state.

Definition at line 271 of file restore_state.py.

Member Function Documentation

◆ _async_get_restored_data()

StoredState | None homeassistant.helpers.restore_state.RestoreEntity._async_get_restored_data (   self)
private
Get data stored for an entity, if any.

Definition at line 287 of file restore_state.py.

◆ async_get_last_extra_data()

ExtraStoredData | None homeassistant.helpers.restore_state.RestoreEntity.async_get_last_extra_data (   self)
Get the entity specific state data from the previous run.

Definition at line 303 of file restore_state.py.

◆ async_get_last_state()

State | None homeassistant.helpers.restore_state.RestoreEntity.async_get_last_state (   self)
Get the entity state from the previous run.

Definition at line 297 of file restore_state.py.

◆ async_internal_added_to_hass()

◆ async_internal_will_remove_from_hass()

None homeassistant.helpers.restore_state.RestoreEntity.async_internal_will_remove_from_hass (   self)
Run when entity will be removed from hass.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 279 of file restore_state.py.

◆ extra_restore_state_data()


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