mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-24 05:57:56 +00:00
Merged with SP-203
This commit is contained in:
@@ -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,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,
|
||||
|
||||
Reference in New Issue
Block a user