Skip to content

Commit

Permalink
Merge pull request #16 from timniklas/timniklas-patch-1
Browse files Browse the repository at this point in the history
fixed error "Error communicating with API: 'address'"
  • Loading branch information
timniklas authored Oct 21, 2024
2 parents 7f787ee + 9eae3bc commit 3abe0e8
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 3abe0e8

Please sign in to comment.