From 1299ea28ea2a9c8d74842cbfbb8256be8ee54881 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 13 Jul 2026 17:13:03 +0200 Subject: [PATCH] Use EntityStateAttribute enum in Kiwi (#176400) --- homeassistant/components/kiwi/lock.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/kiwi/lock.py b/homeassistant/components/kiwi/lock.py index c264f05f9916..4cd03a8e9653 100644 --- a/homeassistant/components/kiwi/lock.py +++ b/homeassistant/components/kiwi/lock.py @@ -13,10 +13,9 @@ from homeassistant.components.lock import ( ) from homeassistant.const import ( ATTR_ID, - ATTR_LATITUDE, - ATTR_LONGITUDE, CONF_PASSWORD, CONF_USERNAME, + EntityStateAttribute, ) from homeassistant.core import HomeAssistant, callback from homeassistant.helpers import config_validation as cv @@ -68,12 +67,8 @@ class KiwiLock(LockEntity): self._state = LockState.LOCKED address = kiwi_lock.get("address") - address.update( - { - ATTR_LATITUDE: address.pop("lat", None), - ATTR_LONGITUDE: address.pop("lng", None), - } - ) + latitude = address.pop("lat", None) + longitude = address.pop("lng", None) self._device_attrs = { ATTR_ID: self.lock_id, @@ -81,6 +76,8 @@ class KiwiLock(LockEntity): ATTR_PERMISSION: kiwi_lock.get("highest_permission"), ATTR_CAN_INVITE: kiwi_lock.get("can_invite"), **address, + EntityStateAttribute.LATITUDE: latitude, + EntityStateAttribute.LONGITUDE: longitude, } @property