Fix broken Yale lock (#75918)

Yale fix lock
This commit is contained in:
G Johansson 2022-07-29 11:57:19 +02:00 committed by GitHub
parent aec885a467
commit 08b169a7ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,6 +46,7 @@ class YaleDoorlock(YaleEntity, LockEntity):
"""Initialize the Yale Lock Device."""
super().__init__(coordinator, data)
self._attr_code_format = f"^\\d{code_format}$"
self.lock_name = data["name"]
async def async_unlock(self, **kwargs: Any) -> None:
"""Send unlock command."""
@ -65,7 +66,7 @@ class YaleDoorlock(YaleEntity, LockEntity):
try:
get_lock = await self.hass.async_add_executor_job(
self.coordinator.yale.lock_api.get, self._attr_name
self.coordinator.yale.lock_api.get, self.lock_name
)
if command == "locked":
lock_state = await self.hass.async_add_executor_job(