Skip to content

Commit

Permalink
Switched parking and current location, they were backwards
Browse files Browse the repository at this point in the history
  • Loading branch information
dkmcgowan committed Oct 15, 2024
1 parent 9dd3ac4 commit c6c7536
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion custom_components/toyota_na/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async def async_setup_entry(

entity_config = feature_sensor
if entity_config and isinstance(feature, ToyotaLocation):
if vehicle.subscribed is False and entity_config["name"] == "Current Location":
if vehicle.subscribed is False and entity_config["name"] == "Last Parked Location":
continue
locations.append(
ToyotaDeviceTracker(
Expand Down
2 changes: 1 addition & 1 deletion custom_components/toyota_na/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"codeowners": ["@vanstinator, @widewing"],
"requirements": ["toyota-na==2.1.1"],
"issue_tracker": "https://github.com/widewing/ha-toyota-na/issues",
"version": "2.4.9",
"version": "2.4.10",
"iot_class": "cloud_polling"
}
4 changes: 2 additions & 2 deletions custom_components/toyota_na/patch_seventeen_cy.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def _parse_vehicle_status(self, vehicle_status: dict) -> None:

# Real-time location is a one-off, so we'll just parse it out here
if "latitude" in vehicle_status and "longitude" in vehicle_status:
self._features[VehicleFeatures.RealTimeLocation] = ToyotaLocation(
self._features[VehicleFeatures.ParkingLocation] = ToyotaLocation(
vehicle_status["latitude"], vehicle_status["longitude"]
)

Expand Down Expand Up @@ -241,7 +241,7 @@ def _parse_telemetry(self, telemetry: dict) -> None:

# vehicle_location has a different shape and different target entity class
if key == "vehicleLocation" and value is not None:
self._features[VehicleFeatures.ParkingLocation] = ToyotaLocation(
self._features[VehicleFeatures.RealTimeLocation] = ToyotaLocation(
value["latitude"], value["longitude"]
)
continue
Expand Down
4 changes: 2 additions & 2 deletions custom_components/toyota_na/patch_seventeen_cy_plus.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _parse_vehicle_status(self, vehicle_status: dict) -> None:

# Real-time location is a one-off, so we'll just parse it out here
if "latitude" in vehicle_status and "longitude" in vehicle_status:
self._features[VehicleFeatures.RealTimeLocation] = ToyotaLocation(
self._features[VehicleFeatures.ParkingLocation] = ToyotaLocation(
vehicle_status["latitude"], vehicle_status["longitude"]
)

Expand Down Expand Up @@ -223,7 +223,7 @@ def _parse_telemetry(self, telemetry: dict) -> None:

# vehicle_location has a different shape and different target entity class
if key == "vehicleLocation" and value is not None:
self._features[VehicleFeatures.ParkingLocation] = ToyotaLocation(
self._features[VehicleFeatures.RealTimeLocation] = ToyotaLocation(
value["latitude"], value["longitude"]
)
continue
Expand Down

0 comments on commit c6c7536

Please sign in to comment.