diff --git a/components/i_feed/devices/vehicle.py b/components/i_feed/devices/vehicle.py index 41d3bc1..45aa7cf 100644 --- a/components/i_feed/devices/vehicle.py +++ b/components/i_feed/devices/vehicle.py @@ -104,8 +104,12 @@ class Vehicle: :return: True if NCE invoked, otherwise False """ + d = geopy.distance.distance(kilometers=0.4) + tl2_loc = geopy.Point(47.90937, 16.20814) + # Calculate point 400m south of traffic light 2 + nce_point = d.destination(point=tl2_loc, bearing=182) if self._nce_possible and not self._nce_happened: - if self._driven_kms >= NCE_KM: + if self._gps_location.latitude >= nce_point.latitude: self._nce_happened = True self._last_velocity = self.velocity self.velocity = 0