mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 20:09:14 +03:00
начал писать систему формирования виджетов
This commit is contained in:
@@ -1,93 +1,14 @@
|
|||||||
[
|
[
|
||||||
{
|
|
||||||
"type": "Variable",
|
|
||||||
"subtype": "ButtonOut",
|
|
||||||
"id": "btn1",
|
|
||||||
"widget": "toggle",
|
|
||||||
"page": "Кнопки",
|
|
||||||
"descr": "Освещение",
|
|
||||||
"gpio": 13,
|
|
||||||
"inv": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Variable",
|
|
||||||
"subtype": "PwmOut",
|
|
||||||
"id": "pwm1",
|
|
||||||
"widget": "range",
|
|
||||||
"page": "Регуляторы",
|
|
||||||
"descr": "Освещение",
|
|
||||||
"gpio": 14,
|
|
||||||
"inv": false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "ButtonIn",
|
"subtype": "AnalogAdc",
|
||||||
"id": "btn",
|
|
||||||
"widget": "toggle",
|
|
||||||
"page": "Кнопки",
|
|
||||||
"descr": "Освещение",
|
|
||||||
"gpio": 12,
|
|
||||||
"inv": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Reading",
|
|
||||||
"subtype": "OutputValue",
|
|
||||||
"id": "txt",
|
|
||||||
"widget": "anydataRed",
|
|
||||||
"page": "Предупреждения",
|
|
||||||
"descr": "Статус"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Reading",
|
|
||||||
"subtype": "InputValue",
|
|
||||||
"id": "txt",
|
|
||||||
"widget": "inputDgt",
|
|
||||||
"page": "Лимиты",
|
|
||||||
"descr": "Порог"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Reading",
|
|
||||||
"subtype": "Bme280",
|
|
||||||
"id": "t",
|
"id": "t",
|
||||||
"widget": "anydataTmp",
|
"widget": "anydataTmp",
|
||||||
"page": "Сенсоры",
|
"page": "Сенсоры",
|
||||||
"descr": "Температура"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Reading",
|
|
||||||
"subtype": "Bme280",
|
|
||||||
"id": "p",
|
|
||||||
"widget": "anydataMm",
|
|
||||||
"page": "Сенсоры",
|
|
||||||
"descr": "Давление"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Reading",
|
|
||||||
"subtype": "Bme280",
|
|
||||||
"id": "h",
|
|
||||||
"widget": "anydataHum",
|
|
||||||
"page": "Сенсоры",
|
|
||||||
"descr": "Влажность",
|
|
||||||
"int": 10,
|
|
||||||
"addr": "0x78"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Reading",
|
|
||||||
"subtype": "AnalogAdc",
|
|
||||||
"id": "t1",
|
|
||||||
"widget": "anydataDef",
|
|
||||||
"page": "Сенсоры",
|
|
||||||
"descr": "Температура",
|
|
||||||
"pin": 0,
|
|
||||||
"int": 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Reading",
|
|
||||||
"subtype": "AnalogAdc",
|
|
||||||
"id": "t2",
|
|
||||||
"widget": "anydataTmp",
|
|
||||||
"page": "Сенсоры",
|
|
||||||
"descr": "Температура",
|
"descr": "Температура",
|
||||||
|
"map": "1,1024,1,1024",
|
||||||
|
"plus": 0,
|
||||||
|
"multiply": 1,
|
||||||
"pin": 0,
|
"pin": 0,
|
||||||
"int": 15
|
"int": 15
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,5 +70,25 @@
|
|||||||
"descr": "Влажность",
|
"descr": "Влажность",
|
||||||
"int": 10,
|
"int": 10,
|
||||||
"addr": "0x78"
|
"addr": "0x78"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Reading",
|
||||||
|
"subtype": "AnalogAdc",
|
||||||
|
"id": "t1",
|
||||||
|
"widget": "anydataDef",
|
||||||
|
"page": "Сенсоры",
|
||||||
|
"descr": "Температура",
|
||||||
|
"pin": 0,
|
||||||
|
"int": 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Reading",
|
||||||
|
"subtype": "AnalogAdc",
|
||||||
|
"id": "t2",
|
||||||
|
"widget": "anydataTmp",
|
||||||
|
"page": "Сенсоры",
|
||||||
|
"descr": "Температура",
|
||||||
|
"pin": 0,
|
||||||
|
"int": 15
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -25,7 +25,6 @@ void configure(String path) {
|
|||||||
myIoTSensor = (IoTSensor*)getAPI(subtype, jsonArrayElement);
|
myIoTSensor = (IoTSensor*)getAPI(subtype, jsonArrayElement);
|
||||||
if (myIoTSensor) {
|
if (myIoTSensor) {
|
||||||
iotSensors.push_back(myIoTSensor);
|
iotSensors.push_back(myIoTSensor);
|
||||||
// createWidget(jsonArrayElement);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -229,6 +229,10 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length)
|
|||||||
writeFileUint8tByFrames("config.json", payload, length, headerLenth, 256);
|
writeFileUint8tByFrames("config.json", payload, length, headerLenth, 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (headerStr == "/tuoyal") {
|
||||||
|
writeFileUint8tByFrames("layout.json", payload, length, headerLenth, 256);
|
||||||
|
}
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case WStype_BIN: {
|
case WStype_BIN: {
|
||||||
|
|||||||
Reference in New Issue
Block a user