mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 02:47:54 +00:00
curtain wizard
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import 'package:syncrow_app/features/devices/model/status_model.dart';
|
||||
|
||||
class CurtainModel {
|
||||
String control;
|
||||
|
||||
CurtainModel({
|
||||
required this.control,
|
||||
});
|
||||
|
||||
factory CurtainModel.fromJson(List<StatusModel> jsonList) {
|
||||
late String _control;
|
||||
|
||||
for (int i = 0; i < jsonList.length; i++) {
|
||||
if (jsonList[i].code == 'control') {
|
||||
_control = jsonList[i].value ?? false;
|
||||
}
|
||||
}
|
||||
return CurtainModel(
|
||||
control: _control,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,9 @@ class DevicesCategoryModel {
|
||||
: name = json['groupName'],
|
||||
// id = json['groupId'],
|
||||
type = devicesTypesMap[json['groupName']] ?? DeviceType.Other,
|
||||
icon = deviceTypeIconMap[devicesTypesMap[json['groupName']] ?? DeviceType.Other] ?? '',
|
||||
icon = deviceTypeIconMap[
|
||||
devicesTypesMap[json['groupName']] ?? DeviceType.Other] ??
|
||||
'',
|
||||
devices = [],
|
||||
isSelected = false;
|
||||
|
||||
@@ -65,8 +67,8 @@ Map<DeviceType, String> deviceTypeIconMap = {
|
||||
DeviceType.WH: Assets.waterHeaterIcon,
|
||||
DeviceType.DS: Assets.doorSensorIcon,
|
||||
DeviceType.Other: Assets.assetsIconsAC,
|
||||
DeviceType.OneTouch: Assets.oneGang,
|
||||
DeviceType.TowTouch: Assets.twoGang,
|
||||
DeviceType.ThreeTouch: Assets.assetsIconsGang,
|
||||
DeviceType.OneTouch: Assets.gang1touch,
|
||||
DeviceType.TowTouch: Assets.gang2touch,
|
||||
DeviceType.ThreeTouch: Assets.gang3touch,
|
||||
DeviceType.GarageDoor: Assets.garageIcon
|
||||
};
|
||||
|
||||
@@ -67,13 +67,13 @@ class DeviceModel {
|
||||
} else if (type == DeviceType.DS) {
|
||||
tempIcon = Assets.doorSensorIcon;
|
||||
} else if (type == DeviceType.OneTouch) {
|
||||
tempIcon = Assets.oneGang;
|
||||
tempIcon = Assets.gang1touch;
|
||||
} else if (type == DeviceType.TowTouch) {
|
||||
tempIcon = Assets.twoGang;
|
||||
tempIcon = Assets.gang2touch;
|
||||
} else if (type == DeviceType.GarageDoor) {
|
||||
tempIcon = Assets.garageIcon;
|
||||
} else if (type == DeviceType.ThreeTouch) {
|
||||
tempIcon = Assets.assetsIcons3GangSwitch;
|
||||
tempIcon = Assets.gang3touch;
|
||||
} else if (type == DeviceType.WaterLeak) {
|
||||
tempIcon = Assets.waterLeakIcon;
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
class GroupCurtainModel {
|
||||
final String deviceId;
|
||||
final String deviceName;
|
||||
String firstSwitch;
|
||||
int percentControl;
|
||||
|
||||
GroupCurtainModel({
|
||||
required this.deviceId,
|
||||
required this.deviceName,
|
||||
required this.firstSwitch,
|
||||
required this.percentControl,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user