count_down_ac

This commit is contained in:
mohammad
2025-01-08 17:17:52 +03:00
parent cff8c4728c
commit 7a22bb4bc8
18 changed files with 779 additions and 99 deletions
+6
View File
@@ -11,12 +11,14 @@ class AcStatusModel {
bool childLock;
late TempModes acMode;
late FanSpeeds acFanSpeed;
int countdown1;
AcStatusModel(
{required this.uuid,
required this.acSwitch,
required this.modeString,
required this.tempSet,
required this.countdown1,
required this.currentTemp,
required this.fanSpeedsString,
required this.childLock}) {
@@ -30,6 +32,7 @@ class AcStatusModel {
late int _tempSet;
late int _currentTemp;
late String _fanSpeeds;
late int _countdown1;
late bool _childLock;
for (int i = 0; i < jsonList.length; i++) {
if (jsonList[i].code == 'switch') {
@@ -44,6 +47,8 @@ class AcStatusModel {
_fanSpeeds = jsonList[i].value ?? 210;
} else if (jsonList[i].code == 'child_lock') {
_childLock = jsonList[i].value ?? false;
} else if (jsonList[i].code == 'countdown_time') {
_countdown1 = jsonList[i].value ?? 0;
}
}
return AcStatusModel(
@@ -53,6 +58,7 @@ class AcStatusModel {
tempSet: _tempSet,
currentTemp: _currentTemp,
fanSpeedsString: _fanSpeeds,
countdown1: _countdown1,
childLock: _childLock);
}