Skip to content

Commit

Permalink
Add support for entity name in GeoJSON
Browse files Browse the repository at this point in the history
Previously GeoJSON names were just the config entry ID. This is not very user friendly. Particularly so when there are many config entries and many, many entities from those same many config entries.
  • Loading branch information
codyc1515 committed Jan 24, 2024
1 parent cffd95a commit 18a8e76
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion homeassistant/components/geo_json_events/geo_location.py
Expand Up @@ -104,7 +104,11 @@ async def async_update(self) -> None:

def _update_from_feed(self, feed_entry: GenericFeedEntry) -> None:
"""Update the internal state from the provided feed entry."""
self._attr_name = feed_entry.title
self._attr_name = (
feed_entry.properties.get("name")
if feed_entry.properties and "name" in feed_entry.properties
else feed_entry.title
)
self._attr_distance = feed_entry.distance_to_home
self._attr_latitude = feed_entry.coordinates[0]
self._attr_longitude = feed_entry.coordinates[1]
Expand Down

0 comments on commit 18a8e76

Please sign in to comment.