Add verisure lock method attribute (#70375)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
pull/70473/head^2
prokon 2022-05-03 09:49:12 +02:00 committed by GitHub
parent a875789987
commit 1ef060700a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -99,6 +99,11 @@ class VerisureDoorlock(CoordinatorEntity[VerisureDataUpdateCoordinator], LockEnt
"""Last change triggered by."""
return self.coordinator.data["locks"][self.serial_number].get("userString")
@property
def changed_method(self) -> str:
"""Last change method."""
return self.coordinator.data["locks"][self.serial_number]["method"]
@property
def code_format(self) -> str:
"""Return the required six digit code."""
@ -112,6 +117,11 @@ class VerisureDoorlock(CoordinatorEntity[VerisureDataUpdateCoordinator], LockEnt
== "LOCKED"
)
@property
def extra_state_attributes(self):
"""Return the state attributes."""
return {"method": self.changed_method}
async def async_unlock(self, **kwargs) -> None:
"""Send unlock command."""
code = kwargs.get(