aboutsummaryrefslogtreecommitdiffstats
path: root/lib/data/data_providers
diff options
context:
space:
mode:
authorLisandro Pérez Meyer <lpmeyer@ics.com>2023-11-17 09:17:29 -0300
committerLisandro Perez Meyer <lpmeyer@ics.com>2023-11-17 14:11:43 +0000
commit0016d533a9fc601aa65f69a050c60c8d6158ed36 (patch)
tree6fd0765f9d1006a2bddd142caf1d7c0a9d5482cf /lib/data/data_providers
parent4d77bab5a0f698943d1abf74482eecef7cc95f08 (diff)
Disable value animation at start up % update FuelLevel path.
Also: - Remove some warnings. - Improvements of hvac temp buttons. Original from: Dominik Wawrzonek <dwawrzonek@ics.com> Bug-AGL: SPEC-4971 Change-Id: Ic10e9ec5ec79f79f63d951469924325f29ea3fa7 Signed-off-by: Lisandro Pérez Meyer <lpmeyer@ics.com>
Diffstat (limited to 'lib/data/data_providers')
-rw-r--r--lib/data/data_providers/vehicle_notifier.dart42
1 files changed, 40 insertions, 2 deletions
diff --git a/lib/data/data_providers/vehicle_notifier.dart b/lib/data/data_providers/vehicle_notifier.dart
index fb69595..b9a543c 100644
--- a/lib/data/data_providers/vehicle_notifier.dart
+++ b/lib/data/data_providers/vehicle_notifier.dart
@@ -136,7 +136,17 @@ class VehicleNotifier extends StateNotifier<Vehicle> {
state = state.copyWith(fanSpeed: update.entry.value.uint32);
}
break;
-
+ case VSSPath.vehicleDriverTemperature:
+ if (update.entry.value.hasInt32()) {
+ state = state.copyWith(driverTemperature: update.entry.value.int32);
+ }
+ break;
+ case VSSPath.vehiclePassengerTemperature:
+ if (update.entry.value.hasInt32()) {
+ state =
+ state.copyWith(passengerTemperature: update.entry.value.int32);
+ }
+ break;
// default:
// debugPrint("ERROR: Unexpected path ${update.entry.path}");
// break;
@@ -302,7 +312,6 @@ class VehicleNotifier extends StateNotifier<Vehicle> {
}, onError: (stacktrace, errorDescriptor) {
debugPrint(stacktrace.toString());
state = const Vehicle.initialForDebug();
-
});
} catch (e) {
debugPrint(e.toString());
@@ -340,6 +349,35 @@ class VehicleNotifier extends StateNotifier<Vehicle> {
}
}
+ void setTemperature({required Side side, required int value}) {
+ var helper = ValClientHelper(channel: channel, stub: stub);
+ try {
+ switch (side) {
+ case Side.left:
+ helper.setInt32(
+ VSSPath.vehicleDriverTemperature,
+ value,
+ false,
+ );
+ state = state.copyWith(driverTemperature: value);
+ break;
+ case Side.right:
+ helper.setInt32(
+ VSSPath.vehiclePassengerTemperature,
+ value,
+ false,
+ );
+ state = state.copyWith(passengerTemperature: value);
+ break;
+ default:
+ debugPrint("ERROR: Unexpected side value $side}");
+ break;
+ }
+ } catch (e) {
+ debugPrint(e.toString());
+ }
+ }
+
void updateFanSpeed(int newValue) {
state = state.copyWith(fanSpeed: newValue);
}