gcobb321 / icloud3

iCloud3 v3 - iCloud3 is an advanced iDevice tracker that uses Apple iCloud account and HA Companion App data for presence detection and location based automations.
MIT License
581 stars 54 forks source link

Error with Waze calculation #212

Closed MrAlucardDante closed 2 years ago

MrAlucardDante commented 2 years ago

Today, I checked my logs and saw 385 errors from the waze calculator logic in iCloud3

Here is the log :

Logger: custom_components.icloud3.device_tracker
Source: custom_components/icloud3/waze_route_calc_ic3.py:145
Integration: icloud3 ([documentation](https://gcobb321.github.io/icloud3/#/), [issues](https://github.com/gcobb321/icloud3/issues))
First occurred: 08:43:20 (385 occurrences)
Last logged: 17:34:30
'result'

Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/custom_components/icloud3/device_tracker.py", line 8359, in _get_waze_distance
    self.WazeRouteCalc.calc_route_info(from_lat, from_long, to_lat, to_long)
  File "/home/homeassistant/.homeassistant/custom_components/icloud3/waze_route_calc_ic3.py", line 145, in calc_route_info
    route_time, route_distance = self._add_up_route(route['result'])
KeyError: 'result'

I looked up at the previous issues https://github.com/gcobb321/icloud3/issues/184 and https://github.com/gcobb321/icloud3/issues/174

I am running the latest version of the WareRouteCalculator (0.15), installed manually because I'm running HA Core, I installed it in the same venv with the same user as HA.

Maybe Waze changed something again.

MrAlucardDante commented 2 years ago

I'm running those versions if it helps : iCloud3 v2.4.7 Home Assistant Core : 2022.3.8, running on python 3.8 HACS : 1.24.3