Skip to content

Commit

Permalink
Add raw attributes to address sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
pnbruckner committed Jun 4, 2024
1 parent 6313a42 commit 2feb70f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions custom_components/entity_tz/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 2feb70f

Please sign in to comment.