Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.lock.LockEntity Class Reference

Inherits homeassistant.helpers.entity.Entity, cached_properties, and CACHED_PROPERTIES_WITH_ATTR_.

Inherited by homeassistant.components.abode.lock.AbodeLock, homeassistant.components.august.lock.AugustLock, homeassistant.components.bmw_connected_drive.lock.BMWLock, homeassistant.components.demo.lock.DemoLock, homeassistant.components.dormakaba_dkey.lock.DormakabaDkeyLock, homeassistant.components.esphome.lock.EsphomeLock, homeassistant.components.fibaro.lock.FibaroLock, homeassistant.components.freedompro.lock.Device, homeassistant.components.group.lock.LockGroup, homeassistant.components.homekit_controller.lock.HomeKitLock, homeassistant.components.homematic.lock.HMLock, homeassistant.components.homematicip_cloud.lock.HomematicipDoorLockDrive, homeassistant.components.insteon.lock.InsteonLockEntity, homeassistant.components.isy994.lock.ISYLockEntity, homeassistant.components.isy994.lock.ISYLockProgramEntity, homeassistant.components.keba.lock.KebaLock, homeassistant.components.kitchen_sink.lock.DemoLock, homeassistant.components.kiwi.lock.KiwiLock, homeassistant.components.loqed.lock.LoqedLock, homeassistant.components.matter.lock.MatterLock, homeassistant.components.mqtt.lock.MqttLock, homeassistant.components.overkiz.lock.OverkizLock, homeassistant.components.schlage.lock.SchlageLockEntity, homeassistant.components.sesame.lock.SesameDevice, homeassistant.components.simplisafe.lock.SimpliSafeLock, homeassistant.components.smartthings.lock.SmartThingsLock, homeassistant.components.starline.lock.StarlineLock, homeassistant.components.subaru.lock.SubaruLock, homeassistant.components.surepetcare.lock.SurePetcareLock, homeassistant.components.switchbot.lock.SwitchBotLock, homeassistant.components.switchbot_cloud.lock.SwitchBotCloudLock, homeassistant.components.tedee.lock.TedeeLockEntity, homeassistant.components.template.lock.TemplateLock, homeassistant.components.tesla_fleet.lock.TeslaFleetCableLockEntity, homeassistant.components.tesla_fleet.lock.TeslaFleetVehicleLockEntity, homeassistant.components.teslemetry.lock.TeslemetryCableLockEntity, homeassistant.components.teslemetry.lock.TeslemetryVehicleLockEntity, homeassistant.components.tessie.lock.TessieCableLockEntity, homeassistant.components.tessie.lock.TessieLockEntity, homeassistant.components.unifiprotect.lock.ProtectLock, homeassistant.components.vera.lock.VeraLock, homeassistant.components.verisure.lock.VerisureDoorlock, homeassistant.components.volvooncall.lock.VolvoLock, homeassistant.components.wallbox.lock.WallboxLock, homeassistant.components.xiaomi_aqara.lock.XiaomiAqaraLock, homeassistant.components.yale.lock.YaleLock, homeassistant.components.yale_smart_alarm.lock.YaleDoorlock, homeassistant.components.yalexs_ble.lock.YaleXSBLELock, homeassistant.components.yolink.lock.YoLinkLockEntity, homeassistant.components.zha.lock.ZhaDoorLock, and homeassistant.components.zwave_me.lock.ZWaveMeLock.

Collaboration diagram for homeassistant.components.lock.LockEntity:
[legend]

Public Member Functions

dict[Any, Any] add_default_code (self, dict[Any, Any] data)
 
None async_handle_lock_service (self, **Any kwargs)
 
None async_handle_open_service (self, **Any kwargs)
 
None async_handle_unlock_service (self, **Any kwargs)
 
None async_internal_added_to_hass (self)
 
None async_lock (self, **Any kwargs)
 
None async_open (self, **Any kwargs)
 
None async_registry_entry_updated (self)
 
None async_unlock (self, **Any kwargs)
 
str|None changed_by (self)
 
str|None code_format (self)
 
re.Pattern[str]|None code_format_cmp (self)
 
bool|None is_jammed (self)
 
bool|None is_locked (self)
 
bool|None is_locking (self)
 
bool|None is_open (self)
 
bool|None is_opening (self)
 
bool|None is_unlocking (self)
 
None lock (self, **Any kwargs)
 
None open (self, **Any kwargs)
 
str|None state (self)
 
dict[str, StateTypestate_attributes (self)
 
LockEntityFeature supported_features (self)
 
None unlock (self, **Any kwargs)
 
- 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_internal_will_remove_from_hass (self)
 
None async_on_remove (self, CALLBACK_TYPE func)
 
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)
 
str|None suggested_object_id (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)
 

Static Public Attributes

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

Private Member Functions

None _async_read_entity_options (self)
 

Private Attributes

 __code_format_cmp
 
 _lock_option_default_code
 

Additional Inherited Members

- Public Attributes inherited from homeassistant.helpers.entity.Entity
 device_entry
 
 entity_id
 
 hass
 
 parallel_updates
 
 platform
 
 registry_entry
 

Detailed Description

Base class for lock entities.

Definition at line 130 of file __init__.py.

Member Function Documentation

◆ _async_read_entity_options()

None homeassistant.components.lock.LockEntity._async_read_entity_options (   self)
private
Read entity options from entity registry.

Called when the entity registry entry has been updated and before the lock is
added to the state machine.

Definition at line 313 of file __init__.py.

◆ add_default_code()

dict[Any, Any] homeassistant.components.lock.LockEntity.add_default_code (   self,
dict[Any, Any]  data 
)
Add default lock code.

Definition at line 149 of file __init__.py.

◆ async_handle_lock_service()

None homeassistant.components.lock.LockEntity.async_handle_lock_service (   self,
**Any  kwargs 
)
Add default code and lock.

Definition at line 224 of file __init__.py.

◆ async_handle_open_service()

None homeassistant.components.lock.LockEntity.async_handle_open_service (   self,
**Any  kwargs 
)
Add default code and open.

Definition at line 250 of file __init__.py.

◆ async_handle_unlock_service()

None homeassistant.components.lock.LockEntity.async_handle_unlock_service (   self,
**Any  kwargs 
)
Add default code and unlock.

Definition at line 237 of file __init__.py.

◆ async_internal_added_to_hass()

None homeassistant.components.lock.LockEntity.async_internal_added_to_hass (   self)
Call when the sensor entity is added to hass.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 300 of file __init__.py.

◆ async_lock()

None homeassistant.components.lock.LockEntity.async_lock (   self,
**Any  kwargs 
)
Lock the lock.

Reimplemented in homeassistant.components.zha.lock.ZhaDoorLock, homeassistant.components.yolink.lock.YoLinkLockEntity, homeassistant.components.yalexs_ble.lock.YaleXSBLELock, homeassistant.components.yale_smart_alarm.lock.YaleDoorlock, homeassistant.components.yale.lock.YaleLock, homeassistant.components.wallbox.lock.WallboxLock, homeassistant.components.volvooncall.lock.VolvoLock, homeassistant.components.verisure.lock.VerisureDoorlock, homeassistant.components.unifiprotect.lock.ProtectLock, homeassistant.components.tessie.lock.TessieCableLockEntity, homeassistant.components.tessie.lock.TessieLockEntity, homeassistant.components.teslemetry.lock.TeslemetryCableLockEntity, homeassistant.components.teslemetry.lock.TeslemetryVehicleLockEntity, homeassistant.components.tesla_fleet.lock.TeslaFleetCableLockEntity, homeassistant.components.tesla_fleet.lock.TeslaFleetVehicleLockEntity, homeassistant.components.template.lock.TemplateLock, homeassistant.components.tedee.lock.TedeeLockEntity, homeassistant.components.switchbot_cloud.lock.SwitchBotCloudLock, homeassistant.components.switchbot.lock.SwitchBotLock, homeassistant.components.surepetcare.lock.SurePetcareLock, homeassistant.components.subaru.lock.SubaruLock, homeassistant.components.smartthings.lock.SmartThingsLock, homeassistant.components.simplisafe.lock.SimpliSafeLock, homeassistant.components.schlage.lock.SchlageLockEntity, homeassistant.components.overkiz.lock.OverkizLock, homeassistant.components.mqtt.lock.MqttLock, homeassistant.components.matter.lock.MatterLock, homeassistant.components.loqed.lock.LoqedLock, homeassistant.components.kitchen_sink.lock.DemoLock, homeassistant.components.keba.lock.KebaLock, homeassistant.components.isy994.lock.ISYLockProgramEntity, homeassistant.components.isy994.lock.ISYLockEntity, homeassistant.components.insteon.lock.InsteonLockEntity, homeassistant.components.homematicip_cloud.lock.HomematicipDoorLockDrive, homeassistant.components.homekit_controller.lock.HomeKitLock, homeassistant.components.group.lock.LockGroup, homeassistant.components.freedompro.lock.Device, homeassistant.components.esphome.lock.EsphomeLock, homeassistant.components.dormakaba_dkey.lock.DormakabaDkeyLock, homeassistant.components.demo.lock.DemoLock, homeassistant.components.bmw_connected_drive.lock.BMWLock, and homeassistant.components.august.lock.AugustLock.

Definition at line 232 of file __init__.py.

◆ async_open()

◆ async_registry_entry_updated()

None homeassistant.components.lock.LockEntity.async_registry_entry_updated (   self)
Run when the entity registry entry has been updated.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 308 of file __init__.py.

◆ async_unlock()

None homeassistant.components.lock.LockEntity.async_unlock (   self,
**Any  kwargs 
)
Unlock the lock.

Reimplemented in homeassistant.components.zha.lock.ZhaDoorLock, homeassistant.components.yolink.lock.YoLinkLockEntity, homeassistant.components.yalexs_ble.lock.YaleXSBLELock, homeassistant.components.yale_smart_alarm.lock.YaleDoorlock, homeassistant.components.yale.lock.YaleLock, homeassistant.components.wallbox.lock.WallboxLock, homeassistant.components.volvooncall.lock.VolvoLock, homeassistant.components.verisure.lock.VerisureDoorlock, homeassistant.components.unifiprotect.lock.ProtectLock, homeassistant.components.tessie.lock.TessieCableLockEntity, homeassistant.components.tessie.lock.TessieLockEntity, homeassistant.components.teslemetry.lock.TeslemetryCableLockEntity, homeassistant.components.teslemetry.lock.TeslemetryVehicleLockEntity, homeassistant.components.tesla_fleet.lock.TeslaFleetCableLockEntity, homeassistant.components.tesla_fleet.lock.TeslaFleetVehicleLockEntity, homeassistant.components.template.lock.TemplateLock, homeassistant.components.tedee.lock.TedeeLockEntity, homeassistant.components.switchbot_cloud.lock.SwitchBotCloudLock, homeassistant.components.switchbot.lock.SwitchBotLock, homeassistant.components.surepetcare.lock.SurePetcareLock, homeassistant.components.subaru.lock.SubaruLock, homeassistant.components.simplisafe.lock.SimpliSafeLock, homeassistant.components.schlage.lock.SchlageLockEntity, homeassistant.components.mqtt.lock.MqttLock, homeassistant.components.matter.lock.MatterLock, homeassistant.components.loqed.lock.LoqedLock, homeassistant.components.kitchen_sink.lock.DemoLock, homeassistant.components.keba.lock.KebaLock, homeassistant.components.isy994.lock.ISYLockProgramEntity, homeassistant.components.isy994.lock.ISYLockEntity, homeassistant.components.insteon.lock.InsteonLockEntity, homeassistant.components.homematicip_cloud.lock.HomematicipDoorLockDrive, homeassistant.components.homekit_controller.lock.HomeKitLock, homeassistant.components.group.lock.LockGroup, homeassistant.components.freedompro.lock.Device, homeassistant.components.esphome.lock.EsphomeLock, homeassistant.components.dormakaba_dkey.lock.DormakabaDkeyLock, homeassistant.components.demo.lock.DemoLock, homeassistant.components.bmw_connected_drive.lock.BMWLock, and homeassistant.components.august.lock.AugustLock.

Definition at line 245 of file __init__.py.

◆ changed_by()

str | None homeassistant.components.lock.LockEntity.changed_by (   self)

◆ code_format()

str | None homeassistant.components.lock.LockEntity.code_format (   self)
Regex for code format or None if no code is required.

Reimplemented in homeassistant.components.verisure.lock.VerisureDoorlock, homeassistant.components.template.lock.TemplateLock, and homeassistant.components.matter.lock.MatterLock.

Definition at line 175 of file __init__.py.

◆ code_format_cmp()

re.Pattern[str] | None homeassistant.components.lock.LockEntity.code_format_cmp (   self)
Return a compiled code_format.

Definition at line 181 of file __init__.py.

◆ is_jammed()

◆ is_locked()

bool | None homeassistant.components.lock.LockEntity.is_locked (   self)

◆ is_locking()

◆ is_open()

◆ is_opening()

bool | None homeassistant.components.lock.LockEntity.is_opening (   self)
Return true if the lock is opening.

Reimplemented in homeassistant.components.tedee.lock.TedeeLockEntity, and homeassistant.components.demo.lock.DemoLock.

Definition at line 214 of file __init__.py.

◆ is_unlocking()

◆ lock()

◆ open()

None homeassistant.components.lock.LockEntity.open (   self,
**Any  kwargs 
)
Open the door latch.

Reimplemented in homeassistant.components.homematic.lock.HMLock.

Definition at line 254 of file __init__.py.

◆ state()

str | None homeassistant.components.lock.LockEntity.state (   self)
Return the state.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 274 of file __init__.py.

◆ state_attributes()

dict[str, StateType] homeassistant.components.lock.LockEntity.state_attributes (   self)
Return the state attributes.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 264 of file __init__.py.

◆ supported_features()

LockEntityFeature homeassistant.components.lock.LockEntity.supported_features (   self)
Return the list of supported features.

Reimplemented from homeassistant.helpers.entity.Entity.

Reimplemented in homeassistant.components.tedee.lock.TedeeLockWithLatchEntity.

Definition at line 291 of file __init__.py.

◆ unlock()

Member Data Documentation

◆ __code_format_cmp

homeassistant.components.lock.LockEntity.__code_format_cmp
private

Definition at line 184 of file __init__.py.

◆ _lock_option_default_code

homeassistant.components.lock.LockEntity._lock_option_default_code
private

Definition at line 326 of file __init__.py.

◆ LockEntityFeature

homeassistant.components.lock.LockEntity.LockEntityFeature
static

Definition at line 143 of file __init__.py.

◆ None

homeassistant.components.lock.LockEntity.None
static

Definition at line 134 of file __init__.py.

◆ str

homeassistant.components.lock.LockEntity.str
static

Definition at line 144 of file __init__.py.


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