mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00
two touch & three touch
This commit is contained in:
@ -51,6 +51,9 @@ enum DeviceType {
|
||||
WH,
|
||||
DS,
|
||||
OneTouch,
|
||||
TowTouch,
|
||||
ThreeTouch,
|
||||
|
||||
Other,
|
||||
}
|
||||
|
||||
@ -78,6 +81,8 @@ Map<String, DeviceType> devicesTypesMap = {
|
||||
"WH": DeviceType.WH,
|
||||
"DS": DeviceType.DS,
|
||||
"1GT": DeviceType.OneTouch,
|
||||
"2GT": DeviceType.TowTouch,
|
||||
"3GT": DeviceType.ThreeTouch,
|
||||
};
|
||||
Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
DeviceType.AC: [
|
||||
@ -321,6 +326,110 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
"range": ['power_off', 'power_on', 'last']
|
||||
})),
|
||||
],
|
||||
DeviceType.TowTouch: [
|
||||
FunctionModel(
|
||||
code: 'switch_1',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'switch_2',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'countdown_1',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'countdown_2',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'relay_status',
|
||||
type: functionTypesMap['Enum'],
|
||||
values: ValueModel.fromJson({
|
||||
"range": ['power_off', 'power_on', 'last']
|
||||
})),
|
||||
FunctionModel(
|
||||
code: 'light_mode',
|
||||
type: functionTypesMap['Enum'],
|
||||
values: ValueModel.fromJson({
|
||||
"range": ['none', 'relay', 'pos']
|
||||
})),
|
||||
FunctionModel(
|
||||
code: 'relay_status_1',
|
||||
type: functionTypesMap['Enum'],
|
||||
values: ValueModel.fromJson({
|
||||
"range": ['power_off', 'power_on', 'last']
|
||||
})),
|
||||
FunctionModel(
|
||||
code: 'relay_status_2',
|
||||
type: functionTypesMap['Enum'],
|
||||
values: ValueModel.fromJson({
|
||||
"range": ['power_off', 'power_on', 'last']
|
||||
})),
|
||||
],
|
||||
|
||||
DeviceType.ThreeTouch: [
|
||||
FunctionModel(
|
||||
code: 'switch_1',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'switch_2',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'switch_3',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'countdown_1',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'countdown_2',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'countdown_3',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'relay_status',
|
||||
type: functionTypesMap['Enum'],
|
||||
values: ValueModel.fromJson({
|
||||
"range": ['power_off', 'power_on', 'last']
|
||||
})),
|
||||
FunctionModel(
|
||||
code: 'light_mode',
|
||||
type: functionTypesMap['Enum'],
|
||||
values: ValueModel.fromJson({
|
||||
"range": ['none', 'relay', 'pos']
|
||||
})),
|
||||
FunctionModel(
|
||||
code: 'relay_status_1',
|
||||
type: functionTypesMap['Enum'],
|
||||
values: ValueModel.fromJson({
|
||||
"range": ['power_off', 'power_on', 'last']
|
||||
})),
|
||||
FunctionModel(
|
||||
code: 'relay_status_2',
|
||||
type: functionTypesMap['Enum'],
|
||||
values: ValueModel.fromJson({
|
||||
"range": ['power_off', 'power_on', 'last']
|
||||
})),
|
||||
FunctionModel(
|
||||
code: 'relay_status_3',
|
||||
type: functionTypesMap['Enum'],
|
||||
values: ValueModel.fromJson({
|
||||
"range": ['power_off', 'power_on', 'last']
|
||||
})),
|
||||
],
|
||||
};
|
||||
|
||||
enum TempModes { hot, cold, wind }
|
||||
@ -662,9 +771,9 @@ extension lightStatusExtension on lightStatus {
|
||||
switch (this) {
|
||||
case lightStatus.off:
|
||||
return "Off";
|
||||
case lightStatus.on_off:
|
||||
return "On/Off Status";
|
||||
case lightStatus.switchPosition:
|
||||
return "On/Off Status";
|
||||
case lightStatus.on_off:
|
||||
return "Restart Memory";
|
||||
}
|
||||
}
|
||||
@ -674,9 +783,9 @@ extension lightStatusExtension on lightStatus {
|
||||
case "none":
|
||||
return lightStatus.off;
|
||||
case "relay":
|
||||
return lightStatus.on_off;
|
||||
case "pos":
|
||||
return lightStatus.switchPosition;
|
||||
case "pos":
|
||||
return lightStatus.on_off;
|
||||
default:
|
||||
throw ArgumentError("Invalid access type: $value");
|
||||
}
|
||||
|
Reference in New Issue
Block a user