Merge pull request #23 from SyncrowIOT/Syncing_with_backend

Synced with the backend
This commit is contained in:
Mohammad Salameh
2024-04-30 12:14:10 +03:00
committed by GitHub
19 changed files with 255 additions and 181 deletions

View File

@ -27,6 +27,16 @@ abstract class Constants {
static const String token = '';
}
enum SpaceType { Unit, Building, Floor, Room, Community }
Map<String, SpaceType> spaceTypesMap = {
"unit": SpaceType.Unit,
"building": SpaceType.Building,
"floor": SpaceType.Floor,
"room": SpaceType.Room,
"community": SpaceType.Community,
};
enum DeviceType {
AC,
LightBulb,
@ -42,6 +52,8 @@ enum DeviceType {
enum FunctionType { Boolean, Enum, Integer, Raw, String }
enum ValueACRange { LOW, MIDDLE, HIGH, AUTO }
Map<String, FunctionType> functionTypesMap = {
"Boolean": FunctionType.Boolean,
"Enum": FunctionType.Enum,
@ -50,12 +62,12 @@ Map<String, FunctionType> functionTypesMap = {
"String": FunctionType.String,
};
Map<String, DeviceType> devicesTypesMap = {
"wzdcrqh0": DeviceType.AC,
"wp8ticoo2bhumwgb": DeviceType.Gateway,
"d3ci7gcn": DeviceType.CeilingSensor,
"awu7anehyu5q1iu8": DeviceType.DoorLock,
"awarhusb": DeviceType.WallSensor,
"1a6vgvyi": DeviceType.ThreeGang,
"AC": DeviceType.AC,
"GW": DeviceType.Gateway,
"CPS": DeviceType.CeilingSensor,
"DL": DeviceType.DoorLock,
"WPS": DeviceType.WallSensor,
"3G": DeviceType.ThreeGang,
};
Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
DeviceType.AC: [
@ -67,18 +79,22 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
code: 'mode',
type: functionTypesMap['Enum'],
values: ValueModel.fromJson({
"range": ["cold", "hot", "wind"]
// "range": ["cold", "hot", "wind"]
})),
FunctionModel(
code: 'temp_set',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "", "min": 200, "max": 300, "scale": 1, "step": 5})),
code: 'temp_set',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{
// "unit": {"min": 200, "max": 300, "scale": 1, "step": 5},
},
),
),
FunctionModel(
code: 'level',
type: functionTypesMap['Enum'],
values: ValueModel.fromJson({
"range": ["low", "middle", "high", "auto"]
// "range": ["low", "middle", "high", "auto"]
})),
FunctionModel(
code: 'child_lock',