diff options
Diffstat (limited to 'lib/widgets/left_climate.dart')
-rw-r--r-- | lib/widgets/left_climate.dart | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/lib/widgets/left_climate.dart b/lib/widgets/left_climate.dart index b45eb0b..6e9d275 100644 --- a/lib/widgets/left_climate.dart +++ b/lib/widgets/left_climate.dart @@ -3,16 +3,15 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_hvac/provider.dart'; +import 'package:flutter_hvac/vehicle-signals/vss_provider.dart'; +import 'package:flutter_hvac/vehicle-signals/vss_signal_providers.dart'; +import 'package:flutter_hvac/vehicle-signals/vss_path.dart'; import 'package:numberpicker/numberpicker.dart'; -import '../kuksa-server/vehicle_methods.dart'; import '../size.dart'; class LeftClimateScrollWidget extends ConsumerWidget { - LeftClimateScrollWidget({Key? key, required this.socket}) : super(key: key); - - WebSocket socket; + LeftClimateScrollWidget({Key? key}) : super(key: key); @override Widget build(BuildContext context, ref) { @@ -41,16 +40,11 @@ class LeftClimateScrollWidget extends ConsumerWidget { }, onChanged: (value) { ref.read(LeftClimateTempProvider.notifier).update(value); - VISS.set( - socket, - ref, - 'Vehicle.Cabin.HVAC.Station.Row1.Left.Temperature', - value.toString()); - VISS.set( - socket, - ref, - 'Vehicle.Cabin.HVAC.Station.Row2.Left.Temperature', - value.toString()); + var vss = ref.read(vssClientProvider); + if (vss != null) { + vss.setInt32(VSSPath.vehicleFrontLeftTemp, value); + vss.setInt32(VSSPath.vehicleRearLeftTemp, value); + } }, selectedTextStyle: TextStyle( color: Colors.lightBlueAccent, |