From 1ef060700a02a46ce6de554aaf5e9d4be3ecbd00 Mon Sep 17 00:00:00 2001 From: prokon <67952017+prokon@users.noreply.github.com> Date: Tue, 3 May 2022 09:49:12 +0200 Subject: [PATCH] Add verisure lock method attribute (#70375) Co-authored-by: Martin Hjelmare --- homeassistant/components/verisure/lock.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/homeassistant/components/verisure/lock.py b/homeassistant/components/verisure/lock.py index 0e28298b2e8..8f9556643f8 100644 --- a/homeassistant/components/verisure/lock.py +++ b/homeassistant/components/verisure/lock.py @@ -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(