mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +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",
|
||||
"subtype": "ButtonIn",
|
||||
"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",
|
||||
"subtype": "AnalogAdc",
|
||||
"id": "t",
|
||||
"widget": "anydataTmp",
|
||||
"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": "Температура",
|
||||
"map": "1,1024,1,1024",
|
||||
"plus": 0,
|
||||
"multiply": 1,
|
||||
"pin": 0,
|
||||
"int": 15
|
||||
}
|
||||
|
||||
@@ -70,5 +70,25 @@
|
||||
"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": "Температура",
|
||||
"pin": 0,
|
||||
"int": 15
|
||||
}
|
||||
]
|
||||
@@ -25,7 +25,6 @@ void configure(String path) {
|
||||
myIoTSensor = (IoTSensor*)getAPI(subtype, jsonArrayElement);
|
||||
if (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);
|
||||
}
|
||||
|
||||
if (headerStr == "/tuoyal") {
|
||||
writeFileUint8tByFrames("layout.json", payload, length, headerLenth, 256);
|
||||
}
|
||||
|
||||
} break;
|
||||
|
||||
case WStype_BIN: {
|
||||
|
||||
Reference in New Issue
Block a user