Merged with SP-203

This commit is contained in:
Abdullah Alassaf
2024-07-25 14:15:06 +03:00
46 changed files with 1973 additions and 811 deletions
+5 -2
View File
@@ -2,6 +2,7 @@ import 'package:syncrow_app/features/devices/model/status_model.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
class AcStatusModel {
String uuid;
bool acSwitch;
String modeString;
int tempSet;
@@ -12,7 +13,8 @@ class AcStatusModel {
late FanSpeeds acFanSpeed;
AcStatusModel(
{required this.acSwitch,
{required this.uuid,
required this.acSwitch,
required this.modeString,
required this.tempSet,
required this.currentTemp,
@@ -22,7 +24,7 @@ class AcStatusModel {
acFanSpeed = getFanSpeed(fanSpeedsString);
}
factory AcStatusModel.fromJson(List<StatusModel> jsonList) {
factory AcStatusModel.fromJson(String id, List<StatusModel> jsonList) {
late bool _acSwitch;
late String _mode;
late int _tempSet;
@@ -45,6 +47,7 @@ class AcStatusModel {
}
}
return AcStatusModel(
uuid: id,
acSwitch: _acSwitch,
modeString: _mode,
tempSet: _tempSet,
+17 -17
View File
@@ -17,12 +17,13 @@ class DeviceModel {
String? timeZone;
int? updateTime;
String? uuid;
String? productUuid;
DeviceType? productType;
bool isSelected = false;
late List<FunctionModel> functions;
DeviceModel(
{this.activeTime,
// this.id,
this.productUuid,
this.localKey,
this.model,
this.name,
@@ -61,27 +62,26 @@ class DeviceModel {
tempIcon = Assets.assetsIconsLogo;
}
return DeviceModel(
icon: tempIcon,
activeTime: json['activeTime'],
// id: json['id'],
localKey: json['localKey'],
model: json['model'],
name: json['name'],
isOnline: json['online'],
productName: json['productName'],
timeZone: json['timeZone'],
updateTime: json['updateTime'],
uuid: json['uuid'],
productType: type,
type: json['productType'],
status: [],
);
icon: tempIcon,
activeTime: json['activeTime'],
// id: json['id'],
localKey: json['localKey'],
model: json['model'],
name: json['name'],
isOnline: json['online'],
productName: json['productName'],
timeZone: json['timeZone'],
updateTime: json['updateTime'],
uuid: json['uuid'],
productType: type,
type: json['productType'],
status: [],
productUuid: json['productUuid']);
}
Map<String, dynamic> toJson() {
return {
'activeTime': activeTime,
// 'id': id,
'localKey': localKey,
'model': model,
'name': name,
@@ -1,9 +1,9 @@
class GroupThreeGangModel {
final String deviceId;
final String deviceName;
final bool firstSwitch;
final bool secondSwitch;
final bool thirdSwitch;
bool firstSwitch;
bool secondSwitch;
bool thirdSwitch;
GroupThreeGangModel({
required this.deviceId,