summaryrefslogtreecommitdiffstats
path: root/lib/vehicle-signals/vss_provider.dart
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2024-01-05 18:50:51 -0500
committerScott Murray <scott.murray@konsulko.com>2024-01-05 18:52:32 -0500
commitdbb971abeaa2beff2a13e421f8cca83b3054db34 (patch)
tree049af6bf56c53534807f6cb5de9803dcb111c4e6 /lib/vehicle-signals/vss_provider.dart
parentda47b0611f7495fb9f4727449721c18c9a617217 (diff)
Fix unit handling
Fix distance unit handling with respect to the VSS signal for that, and add temperature unit support. Bug-AGL: SPEC-5045 Change-Id: I9b25c36c36d19da55f1b9bff7f380c55d592d5d6 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'lib/vehicle-signals/vss_provider.dart')
-rw-r--r--lib/vehicle-signals/vss_provider.dart18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/vehicle-signals/vss_provider.dart b/lib/vehicle-signals/vss_provider.dart
index 7820a52..50a3b6b 100644
--- a/lib/vehicle-signals/vss_provider.dart
+++ b/lib/vehicle-signals/vss_provider.dart
@@ -35,6 +35,7 @@ class DashboardVssClient extends VssClient {
VSSPath.vehicleCruiseControlActive,
VSSPath.vehicleBatteryChargingStatus,
VSSPath.vehicleDistanceUnit,
+ VSSPath.vehicleTemperatureUnit,
VSSPath.steeringCruiseEnable,
VSSPath.steeringCruiseSet,
VSSPath.steeringCruiseResume,
@@ -140,9 +141,9 @@ class DashboardVssClient extends VssClient {
vehicleStatus.update(performanceMode: update.entry.value.string);
}
break;
- case VSSPath.vehicleTravelledDistance:
+ case VSSPath.vehicleTraveledDistance:
if (update.entry.value.hasFloat()) {
- vehicleStatus.update(travelledDistance: update.entry.value.float);
+ vehicleStatus.update(traveledDistance: update.entry.value.float);
}
break;
case VSSPath.vehicleTrunkLocked:
@@ -182,7 +183,18 @@ class DashboardVssClient extends VssClient {
break;
case VSSPath.vehicleDistanceUnit:
if (update.entry.value.hasString()) {
- vehicleStatus.update(vehicleDistanceUnit: update.entry.value.string);
+ DistanceUnit unit = DistanceUnit.kilometers;
+ if (update.entry.value.string == "MILES")
+ unit = DistanceUnit.miles;
+ vehicleStatus.update(distanceUnit: unit);
+ }
+ break;
+ case VSSPath.vehicleTemperatureUnit:
+ if (update.entry.value.hasString()) {
+ TemperatureUnit unit = TemperatureUnit.celsius;
+ if (update.entry.value.string == "F")
+ unit = TemperatureUnit.fahrenheit;
+ vehicleStatus.update(temperatureUnit: unit);
}
break;