diff --git a/sunnypilot/navd/helpers.py b/sunnypilot/navd/helpers.py index 8788653380..041ef6805d 100644 --- a/sunnypilot/navd/helpers.py +++ b/sunnypilot/navd/helpers.py @@ -64,7 +64,10 @@ class Coordinate: haversine_dlon = math.sin(dlon / 2.0) haversine_dlon *= haversine_dlon - y = haversine_dlat + math.cos(math.radians(self.latitude)) * math.cos(math.radians(other.latitude)) * haversine_dlon + y = haversine_dlat \ + + math.cos(math.radians(self.latitude)) \ + * math.cos(math.radians(other.latitude)) \ + * haversine_dlon x = 2 * math.asin(math.sqrt(y)) return x * EARTH_MEAN_RADIUS diff --git a/sunnypilot/navd/navigation_helpers/nav_instructions.py b/sunnypilot/navd/navigation_helpers/nav_instructions.py index 6550cfb843..a734d663ec 100644 --- a/sunnypilot/navd/navigation_helpers/nav_instructions.py +++ b/sunnypilot/navd/navigation_helpers/nav_instructions.py @@ -44,7 +44,7 @@ class NavigationInstructions: distance = distance_to_end_of_step else: distance = step['cumulative_distance'] - closest_cumulative - all_maneuvers.append({'distance': distance, 'type': step['maneuver'], 'modifier': step['modifier']}) + all_maneuvers.append({'distance': distance, 'type': step['maneuver'], 'modifier': step['modifier'], 'instruction': step['instruction']}) return { 'distance_from_route': min_distance, @@ -85,6 +85,7 @@ class NavigationInstructions: 'cumulative_distance': cumulative_distances[closest_idx], 'maxspeed': maxspeed[min(closest_idx, len(maxspeed) - 1)], 'modifier': string_to_direction(step['modifier']), + 'instruction': step['instruction'], }) self._cached_route = { 'steps': steps,