mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Add verisure lock method attribute (#70375)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
a875789987
commit
1ef060700a
@ -99,6 +99,11 @@ class VerisureDoorlock(CoordinatorEntity[VerisureDataUpdateCoordinator], LockEnt
|
|||||||
"""Last change triggered by."""
|
"""Last change triggered by."""
|
||||||
return self.coordinator.data["locks"][self.serial_number].get("userString")
|
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
|
@property
|
||||||
def code_format(self) -> str:
|
def code_format(self) -> str:
|
||||||
"""Return the required six digit code."""
|
"""Return the required six digit code."""
|
||||||
@ -112,6 +117,11 @@ class VerisureDoorlock(CoordinatorEntity[VerisureDataUpdateCoordinator], LockEnt
|
|||||||
== "LOCKED"
|
== "LOCKED"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def extra_state_attributes(self):
|
||||||
|
"""Return the state attributes."""
|
||||||
|
return {"method": self.changed_method}
|
||||||
|
|
||||||
async def async_unlock(self, **kwargs) -> None:
|
async def async_unlock(self, **kwargs) -> None:
|
||||||
"""Send unlock command."""
|
"""Send unlock command."""
|
||||||
code = kwargs.get(
|
code = kwargs.get(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user