Skip to content

Commit

Permalink
fixed error "Error communicating with API: 'address'"
Browse files Browse the repository at this point in the history
  • Loading branch information
timniklas authored Oct 21, 2024
1 parent 7f787ee commit 9eae3bc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion custom_components/blitzerde/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,16 @@ async def async_update_data(self):
mapdata = await self.api.pullMapData()
filtered_list = list(
filter(
lambda mapitem: re.match(self.whitelist, mapitem['address']['city']),
lambda mapitem: 'address' in mapitem,
mapdata
)
)
filtered_list = list(
filter(
lambda mapitem: re.match(self.whitelist, mapitem['address']['city']),
filtered_list
)
)
return BlitzerdeAPIData(mapdata=filtered_list)
except Exception as err:
# This will show entities as unavailable by raising UpdateFailed exception
Expand Down

0 comments on commit 9eae3bc

Please sign in to comment.