mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
changing ac bloc
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user