Skip to content

Commit

Permalink
Move-from-Nominatim-details-to-Nominatim-lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow authored and Snuffy2 committed Nov 15, 2023
1 parent 95ca1e2 commit 3f1b083
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/places/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1779,10 +1779,10 @@ def get_extended_attr(self):
osm_type_abbr = "R"

osm_details_url = (
"https://nominatim.openstreetmap.org/details.php?osmtype="
+ f"{osm_type_abbr}&osmid={self.get_attr(ATTR_OSM_ID)}"
+ "&linkedplaces=1&hierarchy=1&group_hierarchy=1&limit=1&format=json"
+ f"&email={self.get_attr(CONF_API_KEY) if self.is_attr_blank(CONF_API_KEY) else ''}"
"https://nominatim.openstreetmap.org/lookup?osm_ids="
+ f"{osm_type_abbr}{self.get_attr(ATTR_OSM_ID)}"
+ "&format=json&addressdetails=1&extratags=1&namedetails=1"
+ f"&email={self.get_attr(CONF_API_KEY) if not self.is_attr_blank(CONF_API_KEY) else ''}"
+ f"&accept-language={self.get_attr(CONF_LANGUAGE) if not self.is_attr_blank(CONF_LANGUAGE) else ''}"
)
self.set_attr(
Expand Down

0 comments on commit 3f1b083

Please sign in to comment.