From 2feb70fe98d64c1ecb132e378c98b94cdd4f0f26 Mon Sep 17 00:00:00 2001 From: Phil Bruckner Date: Tue, 4 Jun 2024 14:48:47 -0500 Subject: [PATCH] Add raw attributes to address sensor --- custom_components/entity_tz/sensor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/custom_components/entity_tz/sensor.py b/custom_components/entity_tz/sensor.py index 3dd1c6c..bdc0c35 100644 --- a/custom_components/entity_tz/sensor.py +++ b/custom_components/entity_tz/sensor.py @@ -41,10 +41,13 @@ def __init__(self, entry: ConfigEntry) -> None: async def async_update(self) -> None: """Update sensor.""" + self._attr_extra_state_attributes = {} if not self._sources_valid: return self._attr_native_value = self._entity_loc.address + for attr, value in self._entity_loc.raw["address"].items(): + self._attr_extra_state_attributes[attr] = value class EntityCountrySensor(ETZEntity, SensorEntity):