changing ac bloc

This commit is contained in:
ashrafzarkanisala
2024-08-26 00:48:29 +03:00
parent d7e3c1e1d0
commit d94ec25003
23 changed files with 780 additions and 185 deletions

View File

@ -1,28 +1,33 @@
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
import 'package:syncrow_web/utils/constants/const.dart';
enum TempModes { hot, cold, wind }
enum FanSpeeds { auto, low, middle, high }
class AcStatusModel {
String uuid;
bool acSwitch;
String modeString;
int tempSet;
int currentTemp;
String fanSpeedsString;
bool childLock;
// late TempModes acMode;
// late FanSpeeds acFanSpeed;
late TempModes acMode;
late FanSpeeds acFanSpeed;
AcStatusModel(
{required this.acSwitch,
{required this.uuid,
required this.acSwitch,
required this.modeString,
required this.tempSet,
required this.currentTemp,
required this.fanSpeedsString,
required this.childLock}) {
// acMode = getACMode(modeString);
// acFanSpeed = getFanSpeed(fanSpeedsString);
acMode = getACMode(modeString);
acFanSpeed = getFanSpeed(fanSpeedsString);
}
factory AcStatusModel.fromJson(List<Status> jsonList) {
factory AcStatusModel.fromJson(String id, List<Status> jsonList) {
late bool _acSwitch;
late String _mode;
late int _tempSet;
@ -45,6 +50,7 @@ class AcStatusModel {
}
}
return AcStatusModel(
uuid: id,
acSwitch: _acSwitch,
modeString: _mode,
tempSet: _tempSet,