mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 21:34:54 +00:00
Bug fixes
This commit is contained in:
@ -10,6 +10,7 @@ class DeviceModel {
|
||||
String? model;
|
||||
String? name;
|
||||
String? icon;
|
||||
String? type;
|
||||
bool? isOnline;
|
||||
List<StatusModel> status = [];
|
||||
String? productName;
|
||||
@ -19,21 +20,21 @@ class DeviceModel {
|
||||
DeviceType? productType;
|
||||
bool isSelected = false;
|
||||
late List<FunctionModel> functions;
|
||||
DeviceModel({
|
||||
this.activeTime,
|
||||
// this.id,
|
||||
this.localKey,
|
||||
this.model,
|
||||
this.name,
|
||||
this.isOnline,
|
||||
required this.status,
|
||||
this.productName,
|
||||
this.timeZone,
|
||||
this.updateTime,
|
||||
this.uuid,
|
||||
this.productType,
|
||||
this.icon,
|
||||
}) {
|
||||
DeviceModel(
|
||||
{this.activeTime,
|
||||
// this.id,
|
||||
this.localKey,
|
||||
this.model,
|
||||
this.name,
|
||||
this.isOnline,
|
||||
required this.status,
|
||||
this.productName,
|
||||
this.timeZone,
|
||||
this.updateTime,
|
||||
this.uuid,
|
||||
this.productType,
|
||||
this.icon,
|
||||
this.type}) {
|
||||
functions = getFunctions(productType!);
|
||||
}
|
||||
|
||||
@ -43,8 +44,7 @@ class DeviceModel {
|
||||
|
||||
if (type == DeviceType.LightBulb) {
|
||||
tempIcon = Assets.assetsIconsLight;
|
||||
} else if (type == DeviceType.CeilingSensor ||
|
||||
type == DeviceType.WallSensor) {
|
||||
} else if (type == DeviceType.CeilingSensor || type == DeviceType.WallSensor) {
|
||||
tempIcon = Assets.assetsIconsSensors;
|
||||
} else if (type == DeviceType.AC) {
|
||||
tempIcon = Assets.assetsIconsAC;
|
||||
@ -72,6 +72,7 @@ class DeviceModel {
|
||||
updateTime: json['updateTime'],
|
||||
uuid: json['uuid'],
|
||||
productType: type,
|
||||
type: json['productType'],
|
||||
status: [],
|
||||
);
|
||||
}
|
||||
@ -92,6 +93,5 @@ class DeviceModel {
|
||||
};
|
||||
}
|
||||
|
||||
List<FunctionModel> getFunctions(DeviceType type) =>
|
||||
devicesFunctionsMap[productType] ?? [];
|
||||
List<FunctionModel> getFunctions(DeviceType type) => devicesFunctionsMap[productType] ?? [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user