mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-29 15:42:20 +03:00
Merge pull request #161 from biveraxe/ver4dev
Делаем обратный порядок секций в items
This commit is contained in:
@@ -39,7 +39,9 @@ def updateModulesInProfile(profJson):
|
|||||||
modinfoJson = json.load(read_file)
|
modinfoJson = json.load(read_file)
|
||||||
# проверяем есть ли уже узловой элемент и если нет, то создаем
|
# проверяем есть ли уже узловой элемент и если нет, то создаем
|
||||||
if not modinfoJson['menuSection'] in profJson["modules"]:
|
if not modinfoJson['menuSection'] in profJson["modules"]:
|
||||||
profJson["modules"][modinfoJson['menuSection']] = []
|
listFromFirstElement = {modinfoJson['menuSection']: []}
|
||||||
|
listFromFirstElement.update(profJson["modules"])
|
||||||
|
profJson["modules"] = listFromFirstElement
|
||||||
# добавляем информацию о модуле в узловой элемент
|
# добавляем информацию о модуле в узловой элемент
|
||||||
profJson["modules"][modinfoJson['menuSection']].append({
|
profJson["modules"][modinfoJson['menuSection']].append({
|
||||||
'path': root,
|
'path': root,
|
||||||
@@ -77,7 +79,14 @@ if Path(profile).is_file():
|
|||||||
profJson = json.load(read_file)
|
profJson = json.load(read_file)
|
||||||
# если хотим обновить список модулей в существующем профиле
|
# если хотим обновить список модулей в существующем профиле
|
||||||
if update:
|
if update:
|
||||||
updateModulesInProfile(profJson)
|
updateModulesInProfile(profJson)
|
||||||
|
|
||||||
|
# sortedListNames = sorted(profJson["modules"])
|
||||||
|
# sortedModules = {}
|
||||||
|
# for sortedModulName in sortedList:
|
||||||
|
|
||||||
|
print(profJson)
|
||||||
|
|
||||||
with open(profile, "w", encoding='utf-8') as write_file:
|
with open(profile, "w", encoding='utf-8') as write_file:
|
||||||
json.dump(profJson, write_file, ensure_ascii=False, indent=4, sort_keys=False)
|
json.dump(profJson, write_file, ensure_ascii=False, indent=4, sort_keys=False)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -4,158 +4,76 @@
|
|||||||
"num": 0
|
"num": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"header": "Экраны"
|
"header": "Виртуальные элементы"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "1. LCD экран 2004",
|
"name": "1. Таймер",
|
||||||
"type": "Reading",
|
"type": "Writing",
|
||||||
"subtype": "Lcd2004",
|
"subtype": "Timer",
|
||||||
"id": "Lcd",
|
"id": "timer",
|
||||||
"widget": "",
|
"widget": "",
|
||||||
"page": "",
|
"page": "",
|
||||||
"descr": "T",
|
"descr": "",
|
||||||
"int": 15,
|
"int": 1,
|
||||||
"addr": "0x27",
|
"countDown": 15,
|
||||||
"size": "20,4",
|
"ticker": 0,
|
||||||
"coord": "0,0",
|
"repeat": 0,
|
||||||
"id2show": "id датчика",
|
"needSave": 0,
|
||||||
"num": 1
|
"num": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "2. LCD экран 1602",
|
"name": "2. Кнопка",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Lcd2004",
|
"subtype": "Variable",
|
||||||
"id": "Lcd",
|
"id": "vbtn",
|
||||||
"widget": "",
|
|
||||||
"page": "",
|
|
||||||
"descr": "T",
|
|
||||||
"int": 15,
|
|
||||||
"addr": "0x27",
|
|
||||||
"size": "16,2",
|
|
||||||
"coord": "0,0",
|
|
||||||
"id2show": "id датчика",
|
|
||||||
"num": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"header": "Исполнительные устройства"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "3. Кнопка подключенная к пину",
|
|
||||||
"type": "Writing",
|
|
||||||
"subtype": "ButtonIn",
|
|
||||||
"id": "btn",
|
|
||||||
"widget": "toggle",
|
|
||||||
"page": "Кнопки",
|
|
||||||
"descr": "",
|
|
||||||
"int": 0,
|
|
||||||
"pin": 16,
|
|
||||||
"execLevel": "1",
|
|
||||||
"pinMode": "INPUT",
|
|
||||||
"debounceDelay": 50,
|
|
||||||
"fixState": 1,
|
|
||||||
"num": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "4. Кнопка управляющая пином (Реле)",
|
|
||||||
"type": "Writing",
|
|
||||||
"subtype": "ButtonOut",
|
|
||||||
"id": "btn",
|
|
||||||
"widget": "toggle",
|
|
||||||
"page": "Кнопки",
|
|
||||||
"descr": "",
|
|
||||||
"int": 0,
|
|
||||||
"inv": 0,
|
|
||||||
"pin": 2,
|
|
||||||
"num": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5. Поддержка DS1302(1), DS1307(2), DS3231(3), RX8025(4)",
|
|
||||||
"type": "Reading",
|
|
||||||
"subtype": "IarduinoRTC",
|
|
||||||
"id": "RTC",
|
|
||||||
"widget": "",
|
|
||||||
"page": "",
|
|
||||||
"descr": "",
|
|
||||||
"int": "1",
|
|
||||||
"chipNum": 1,
|
|
||||||
"rst": 16,
|
|
||||||
"clk": 5,
|
|
||||||
"dat": 4,
|
|
||||||
"defFormat": "d-m-Y",
|
|
||||||
"ticker": 0,
|
|
||||||
"num": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "6. Сервопривод",
|
|
||||||
"type": "Writing",
|
|
||||||
"subtype": "IoTServo",
|
|
||||||
"id": "servo",
|
|
||||||
"widget": "range",
|
|
||||||
"page": "servo",
|
|
||||||
"descr": "угол",
|
|
||||||
"int": 1,
|
|
||||||
"pin": 12,
|
|
||||||
"apin": -1,
|
|
||||||
"amap": "0, 4096, 0, 180",
|
|
||||||
"num": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "7. Расширитель портов Mcp23017",
|
|
||||||
"type": "Reading",
|
|
||||||
"subtype": "Mcp23017",
|
|
||||||
"id": "Mcp",
|
|
||||||
"widget": "",
|
"widget": "",
|
||||||
"page": "",
|
"page": "",
|
||||||
"descr": "",
|
"descr": "",
|
||||||
"int": "0",
|
"int": "0",
|
||||||
"addr": "0x20",
|
"val": "0",
|
||||||
"index": 1,
|
"num": 2
|
||||||
"num": 7
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "8. MP3 плеер",
|
"name": "3. Окно ввода цифры",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Mp3",
|
"subtype": "Variable",
|
||||||
"id": "mp3",
|
"id": "dedit",
|
||||||
"widget": "",
|
"widget": "",
|
||||||
"page": "",
|
"page": "",
|
||||||
"descr": "",
|
"descr": "",
|
||||||
"int": 1,
|
"int": "0",
|
||||||
"pins": "14,12",
|
"val": "0",
|
||||||
"volume": 20,
|
"num": 3
|
||||||
"num": 8
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "9. PWM ESP8266",
|
"name": "4. Окно ввода времени",
|
||||||
"type": "Writing",
|
|
||||||
"subtype": "Pwm8266",
|
|
||||||
"id": "pwm",
|
|
||||||
"widget": "range",
|
|
||||||
"page": "Кнопки",
|
|
||||||
"descr": "PWM",
|
|
||||||
"int": 0,
|
|
||||||
"pin": 15,
|
|
||||||
"freq": 5000,
|
|
||||||
"val": 0,
|
|
||||||
"apin": -1,
|
|
||||||
"num": 9
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "10. Доп. функции системы",
|
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "SysExt",
|
"subtype": "Variable",
|
||||||
"id": "SysExt",
|
"id": "tedit",
|
||||||
"widget": "",
|
"widget": "",
|
||||||
"page": "",
|
"page": "",
|
||||||
"descr": "",
|
"descr": "",
|
||||||
"int": 15,
|
"int": "0",
|
||||||
"num": 10
|
"val": "0",
|
||||||
|
"num": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "5. Переменная",
|
||||||
|
"type": "Reading",
|
||||||
|
"subtype": "Variable",
|
||||||
|
"id": "var",
|
||||||
|
"widget": "",
|
||||||
|
"page": "",
|
||||||
|
"descr": "",
|
||||||
|
"int": "0",
|
||||||
|
"val": "0",
|
||||||
|
"num": 5
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"header": "Сенсоры"
|
"header": "Сенсоры"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "11. Cенсор температуры AHT20",
|
"name": "6. Cенсор температуры AHT20",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Aht20t",
|
"subtype": "Aht20t",
|
||||||
"id": "Temp20",
|
"id": "Temp20",
|
||||||
@@ -165,10 +83,10 @@
|
|||||||
"int": 15,
|
"int": 15,
|
||||||
"addr": "0x38",
|
"addr": "0x38",
|
||||||
"round": 1,
|
"round": 1,
|
||||||
"num": 11
|
"num": 6
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "12. Cенсор влажности AHT20",
|
"name": "7. Cенсор влажности AHT20",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Aht20h",
|
"subtype": "Aht20h",
|
||||||
"id": "Hum20",
|
"id": "Hum20",
|
||||||
@@ -178,10 +96,10 @@
|
|||||||
"int": 15,
|
"int": 15,
|
||||||
"addr": "0x38",
|
"addr": "0x38",
|
||||||
"round": 1,
|
"round": 1,
|
||||||
"num": 12
|
"num": 7
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "13. Аналоговый сенсор",
|
"name": "8. Аналоговый сенсор",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "AnalogAdc",
|
"subtype": "AnalogAdc",
|
||||||
"id": "t",
|
"id": "t",
|
||||||
@@ -195,10 +113,10 @@
|
|||||||
"pin": 0,
|
"pin": 0,
|
||||||
"int": 15,
|
"int": 15,
|
||||||
"avgSteps": 1,
|
"avgSteps": 1,
|
||||||
"num": 13
|
"num": 8
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "14. Cенсор температуры Bme280",
|
"name": "9. Cенсор температуры Bme280",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Bme280t",
|
"subtype": "Bme280t",
|
||||||
"id": "tmp3",
|
"id": "tmp3",
|
||||||
@@ -208,10 +126,10 @@
|
|||||||
"int": 15,
|
"int": 15,
|
||||||
"addr": "0x77",
|
"addr": "0x77",
|
||||||
"round": 1,
|
"round": 1,
|
||||||
"num": 14
|
"num": 9
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "15. Cенсор давления Bme280",
|
"name": "10. Cенсор давления Bme280",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Bme280p",
|
"subtype": "Bme280p",
|
||||||
"id": "Press3",
|
"id": "Press3",
|
||||||
@@ -221,10 +139,10 @@
|
|||||||
"int": 15,
|
"int": 15,
|
||||||
"addr": "0x77",
|
"addr": "0x77",
|
||||||
"round": 1,
|
"round": 1,
|
||||||
"num": 15
|
"num": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "16. Cенсор влажности Bme280",
|
"name": "11. Cенсор влажности Bme280",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Bme280h",
|
"subtype": "Bme280h",
|
||||||
"id": "Hum3",
|
"id": "Hum3",
|
||||||
@@ -234,10 +152,10 @@
|
|||||||
"int": 15,
|
"int": 15,
|
||||||
"addr": "0x77",
|
"addr": "0x77",
|
||||||
"round": 1,
|
"round": 1,
|
||||||
"num": 16
|
"num": 11
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "17. Cенсор температуры Bmp280",
|
"name": "12. Cенсор температуры Bmp280",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Bmp280t",
|
"subtype": "Bmp280t",
|
||||||
"id": "tmp3",
|
"id": "tmp3",
|
||||||
@@ -247,10 +165,10 @@
|
|||||||
"int": 15,
|
"int": 15,
|
||||||
"addr": "0x77",
|
"addr": "0x77",
|
||||||
"round": 1,
|
"round": 1,
|
||||||
"num": 17
|
"num": 12
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "18. Cенсор давления Bmp280",
|
"name": "13. Cенсор давления Bmp280",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Bmp280p",
|
"subtype": "Bmp280p",
|
||||||
"id": "Press3",
|
"id": "Press3",
|
||||||
@@ -260,10 +178,10 @@
|
|||||||
"int": 15,
|
"int": 15,
|
||||||
"addr": "0x77",
|
"addr": "0x77",
|
||||||
"round": 1,
|
"round": 1,
|
||||||
"num": 18
|
"num": 13
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "19. Cенсор температуры dht11",
|
"name": "14. Cенсор температуры dht11",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Dht1122t",
|
"subtype": "Dht1122t",
|
||||||
"id": "tmp3",
|
"id": "tmp3",
|
||||||
@@ -273,10 +191,10 @@
|
|||||||
"int": 15,
|
"int": 15,
|
||||||
"pin": 0,
|
"pin": 0,
|
||||||
"senstype": "dht11",
|
"senstype": "dht11",
|
||||||
"num": 19
|
"num": 14
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "20. Cенсор влажности dht11",
|
"name": "15. Cенсор влажности dht11",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Dht1122h",
|
"subtype": "Dht1122h",
|
||||||
"id": "Hum3",
|
"id": "Hum3",
|
||||||
@@ -286,10 +204,10 @@
|
|||||||
"int": 15,
|
"int": 15,
|
||||||
"pin": 0,
|
"pin": 0,
|
||||||
"senstype": "dht11",
|
"senstype": "dht11",
|
||||||
"num": 20
|
"num": 15
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "21. Cенсор температуры ds18b20",
|
"name": "16. Cенсор температуры ds18b20",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Ds18b20",
|
"subtype": "Ds18b20",
|
||||||
"id": "dstmp",
|
"id": "dstmp",
|
||||||
@@ -301,10 +219,10 @@
|
|||||||
"index": 0,
|
"index": 0,
|
||||||
"addr": "",
|
"addr": "",
|
||||||
"round": 1,
|
"round": 1,
|
||||||
"num": 21
|
"num": 16
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "22. Cенсор температуры GY21",
|
"name": "17. Cенсор температуры GY21",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "GY21t",
|
"subtype": "GY21t",
|
||||||
"id": "tmp4",
|
"id": "tmp4",
|
||||||
@@ -313,10 +231,10 @@
|
|||||||
"descr": "Температура",
|
"descr": "Температура",
|
||||||
"round": 1,
|
"round": 1,
|
||||||
"int": 15,
|
"int": 15,
|
||||||
"num": 22
|
"num": 17
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "23. Cенсор влажности GY21",
|
"name": "18. Cенсор влажности GY21",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "GY21h",
|
"subtype": "GY21h",
|
||||||
"id": "Hum4",
|
"id": "Hum4",
|
||||||
@@ -325,10 +243,10 @@
|
|||||||
"descr": "Влажность",
|
"descr": "Влажность",
|
||||||
"round": 1,
|
"round": 1,
|
||||||
"int": 15,
|
"int": 15,
|
||||||
"num": 23
|
"num": 18
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "24. Cенсор температуры HDC1080",
|
"name": "19. Cенсор температуры HDC1080",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Hdc1080t",
|
"subtype": "Hdc1080t",
|
||||||
"id": "Temp1080",
|
"id": "Temp1080",
|
||||||
@@ -338,10 +256,10 @@
|
|||||||
"int": 15,
|
"int": 15,
|
||||||
"addr": "0x40",
|
"addr": "0x40",
|
||||||
"round": 1,
|
"round": 1,
|
||||||
"num": 24
|
"num": 19
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "25. Cенсор влажности HDC1080",
|
"name": "20. Cенсор влажности HDC1080",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Hdc1080h",
|
"subtype": "Hdc1080h",
|
||||||
"id": "Hum1080",
|
"id": "Hum1080",
|
||||||
@@ -351,10 +269,10 @@
|
|||||||
"int": 15,
|
"int": 15,
|
||||||
"addr": "0x40",
|
"addr": "0x40",
|
||||||
"round": 1,
|
"round": 1,
|
||||||
"num": 25
|
"num": 20
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "26. Cенсор температуры MAX6675",
|
"name": "21. Cенсор температуры MAX6675",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Max6675t",
|
"subtype": "Max6675t",
|
||||||
"id": "maxtmp",
|
"id": "maxtmp",
|
||||||
@@ -365,11 +283,11 @@
|
|||||||
"DO": 12,
|
"DO": 12,
|
||||||
"CS": 13,
|
"CS": 13,
|
||||||
"CLK": 14,
|
"CLK": 14,
|
||||||
"num": 26
|
"num": 21
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "27. Сканер кнопок 433 MHz",
|
"name": "22. Сканер кнопок 433 MHz",
|
||||||
"num": 27,
|
"num": 22,
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "RCswitch",
|
"subtype": "RCswitch",
|
||||||
"id": "rsw",
|
"id": "rsw",
|
||||||
@@ -378,7 +296,7 @@
|
|||||||
"pinTx": 12
|
"pinTx": 12
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "28. Cенсор температуры Sht20",
|
"name": "23. Cенсор температуры Sht20",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Sht20t",
|
"subtype": "Sht20t",
|
||||||
"id": "tmp2",
|
"id": "tmp2",
|
||||||
@@ -387,10 +305,10 @@
|
|||||||
"descr": "Температура",
|
"descr": "Температура",
|
||||||
"int": 15,
|
"int": 15,
|
||||||
"round": 1,
|
"round": 1,
|
||||||
"num": 28
|
"num": 23
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "29. Cенсор влажности Sht20",
|
"name": "24. Cенсор влажности Sht20",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Sht20h",
|
"subtype": "Sht20h",
|
||||||
"id": "Hum2",
|
"id": "Hum2",
|
||||||
@@ -399,10 +317,10 @@
|
|||||||
"descr": "Влажность",
|
"descr": "Влажность",
|
||||||
"int": 15,
|
"int": 15,
|
||||||
"round": 1,
|
"round": 1,
|
||||||
"num": 29
|
"num": 24
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "30. Cенсор температуры Sht30",
|
"name": "25. Cенсор температуры Sht30",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Sht30t",
|
"subtype": "Sht30t",
|
||||||
"id": "tmp30",
|
"id": "tmp30",
|
||||||
@@ -411,10 +329,10 @@
|
|||||||
"descr": "SHT30 Температура",
|
"descr": "SHT30 Температура",
|
||||||
"int": 15,
|
"int": 15,
|
||||||
"round": 1,
|
"round": 1,
|
||||||
"num": 30
|
"num": 25
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "31. Cенсор влажности Sht30",
|
"name": "26. Cенсор влажности Sht30",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Sht30h",
|
"subtype": "Sht30h",
|
||||||
"id": "Hum30",
|
"id": "Hum30",
|
||||||
@@ -423,11 +341,11 @@
|
|||||||
"descr": "SHT30 Влажность",
|
"descr": "SHT30 Влажность",
|
||||||
"int": 15,
|
"int": 15,
|
||||||
"round": 1,
|
"round": 1,
|
||||||
"num": 31
|
"num": 26
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "32. Сонар HC-SR04",
|
"name": "27. Сонар HC-SR04",
|
||||||
"num": 32,
|
"num": 27,
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Sonar",
|
"subtype": "Sonar",
|
||||||
"id": "sonar",
|
"id": "sonar",
|
||||||
@@ -439,69 +357,151 @@
|
|||||||
"int": 5
|
"int": 5
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"header": "Виртуальные элементы"
|
"header": "Исполнительные устройства"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "33. Таймер",
|
"name": "28. Кнопка подключенная к пину",
|
||||||
"type": "Writing",
|
"type": "Writing",
|
||||||
"subtype": "Timer",
|
"subtype": "ButtonIn",
|
||||||
"id": "timer",
|
"id": "btn",
|
||||||
|
"widget": "toggle",
|
||||||
|
"page": "Кнопки",
|
||||||
|
"descr": "",
|
||||||
|
"int": 0,
|
||||||
|
"pin": 16,
|
||||||
|
"execLevel": "1",
|
||||||
|
"pinMode": "INPUT",
|
||||||
|
"debounceDelay": 50,
|
||||||
|
"fixState": 1,
|
||||||
|
"num": 28
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "29. Кнопка управляющая пином (Реле)",
|
||||||
|
"type": "Writing",
|
||||||
|
"subtype": "ButtonOut",
|
||||||
|
"id": "btn",
|
||||||
|
"widget": "toggle",
|
||||||
|
"page": "Кнопки",
|
||||||
|
"descr": "",
|
||||||
|
"int": 0,
|
||||||
|
"inv": 0,
|
||||||
|
"pin": 2,
|
||||||
|
"num": 29
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "30. Поддержка DS1302(1), DS1307(2), DS3231(3), RX8025(4)",
|
||||||
|
"type": "Reading",
|
||||||
|
"subtype": "IarduinoRTC",
|
||||||
|
"id": "RTC",
|
||||||
|
"widget": "",
|
||||||
|
"page": "",
|
||||||
|
"descr": "",
|
||||||
|
"int": "1",
|
||||||
|
"chipNum": 1,
|
||||||
|
"rst": 16,
|
||||||
|
"clk": 5,
|
||||||
|
"dat": 4,
|
||||||
|
"defFormat": "d-m-Y",
|
||||||
|
"ticker": 0,
|
||||||
|
"num": 30
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "31. Сервопривод",
|
||||||
|
"type": "Writing",
|
||||||
|
"subtype": "IoTServo",
|
||||||
|
"id": "servo",
|
||||||
|
"widget": "range",
|
||||||
|
"page": "servo",
|
||||||
|
"descr": "угол",
|
||||||
|
"int": 1,
|
||||||
|
"pin": 12,
|
||||||
|
"apin": -1,
|
||||||
|
"amap": "0, 4096, 0, 180",
|
||||||
|
"num": 31
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "32. Расширитель портов Mcp23017",
|
||||||
|
"type": "Reading",
|
||||||
|
"subtype": "Mcp23017",
|
||||||
|
"id": "Mcp",
|
||||||
|
"widget": "",
|
||||||
|
"page": "",
|
||||||
|
"descr": "",
|
||||||
|
"int": "0",
|
||||||
|
"addr": "0x20",
|
||||||
|
"index": 1,
|
||||||
|
"num": 32
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "33. MP3 плеер",
|
||||||
|
"type": "Reading",
|
||||||
|
"subtype": "Mp3",
|
||||||
|
"id": "mp3",
|
||||||
"widget": "",
|
"widget": "",
|
||||||
"page": "",
|
"page": "",
|
||||||
"descr": "",
|
"descr": "",
|
||||||
"int": 1,
|
"int": 1,
|
||||||
"countDown": 15,
|
"pins": "14,12",
|
||||||
"ticker": 0,
|
"volume": 20,
|
||||||
"repeat": 0,
|
|
||||||
"needSave": 0,
|
|
||||||
"num": 33
|
"num": 33
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "34. Кнопка",
|
"name": "34. PWM ESP8266",
|
||||||
"type": "Reading",
|
"type": "Writing",
|
||||||
"subtype": "Variable",
|
"subtype": "Pwm8266",
|
||||||
"id": "vbtn",
|
"id": "pwm",
|
||||||
"widget": "",
|
"widget": "range",
|
||||||
"page": "",
|
"page": "Кнопки",
|
||||||
"descr": "",
|
"descr": "PWM",
|
||||||
"int": "0",
|
"int": 0,
|
||||||
"val": "0",
|
"pin": 15,
|
||||||
|
"freq": 5000,
|
||||||
|
"val": 0,
|
||||||
|
"apin": -1,
|
||||||
"num": 34
|
"num": 34
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "35. Окно ввода цифры",
|
"name": "35. Доп. функции системы",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Variable",
|
"subtype": "SysExt",
|
||||||
"id": "dedit",
|
"id": "SysExt",
|
||||||
"widget": "",
|
"widget": "",
|
||||||
"page": "",
|
"page": "",
|
||||||
"descr": "",
|
"descr": "",
|
||||||
"int": "0",
|
"int": 15,
|
||||||
"val": "0",
|
|
||||||
"num": 35
|
"num": 35
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "36. Окно ввода времени",
|
"header": "Экраны"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "36. LCD экран 2004",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Variable",
|
"subtype": "Lcd2004",
|
||||||
"id": "tedit",
|
"id": "Lcd",
|
||||||
"widget": "",
|
"widget": "",
|
||||||
"page": "",
|
"page": "",
|
||||||
"descr": "",
|
"descr": "T",
|
||||||
"int": "0",
|
"int": 15,
|
||||||
"val": "0",
|
"addr": "0x27",
|
||||||
|
"size": "20,4",
|
||||||
|
"coord": "0,0",
|
||||||
|
"id2show": "id датчика",
|
||||||
"num": 36
|
"num": 36
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "37. Переменная",
|
"name": "37. LCD экран 1602",
|
||||||
"type": "Reading",
|
"type": "Reading",
|
||||||
"subtype": "Variable",
|
"subtype": "Lcd2004",
|
||||||
"id": "var",
|
"id": "Lcd",
|
||||||
"widget": "",
|
"widget": "",
|
||||||
"page": "",
|
"page": "",
|
||||||
"descr": "",
|
"descr": "T",
|
||||||
"int": "0",
|
"int": 15,
|
||||||
"val": "0",
|
"addr": "0x27",
|
||||||
|
"size": "16,2",
|
||||||
|
"coord": "0,0",
|
||||||
|
"id2show": "id датчика",
|
||||||
"num": 37
|
"num": 37
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
104
myProfile.json
104
myProfile.json
@@ -26,60 +26,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"modules": {
|
"modules": {
|
||||||
"Экраны": [
|
"Виртуальные элементы": [
|
||||||
{
|
{
|
||||||
"path": "src\\modules\\display\\Lcd2004",
|
"path": "src\\modules\\virtual\\Timer",
|
||||||
"active": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"Исполнительные устройства": [
|
|
||||||
{
|
|
||||||
"path": "src\\modules\\exec\\ButtonIn",
|
|
||||||
"active": true
|
"active": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "src\\modules\\exec\\ButtonOut",
|
"path": "src\\modules\\virtual\\Variable",
|
||||||
"active": true
|
"active": true
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "src\\modules\\exec\\EspCam",
|
|
||||||
"active": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "src\\modules\\exec\\IarduinoRTC",
|
|
||||||
"active": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "src\\modules\\exec\\IoTServo",
|
|
||||||
"active": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "src\\modules\\exec\\Mcp23017",
|
|
||||||
"active": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "src\\modules\\exec\\Mp3",
|
|
||||||
"active": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "src\\modules\\exec\\Pwm32",
|
|
||||||
"active": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "src\\modules\\exec\\Pwm8266",
|
|
||||||
"active": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "src\\modules\\exec\\SDcard",
|
|
||||||
"active": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "src\\modules\\exec\\SysExt",
|
|
||||||
"active": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "src\\modules\\exec\\Telegram",
|
|
||||||
"active": false
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Сенсоры": [
|
"Сенсоры": [
|
||||||
@@ -156,13 +110,59 @@
|
|||||||
"active": true
|
"active": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Виртуальные элементы": [
|
"Исполнительные устройства": [
|
||||||
{
|
{
|
||||||
"path": "src\\modules\\virtual\\Timer",
|
"path": "src\\modules\\exec\\ButtonIn",
|
||||||
"active": true
|
"active": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "src\\modules\\virtual\\Variable",
|
"path": "src\\modules\\exec\\ButtonOut",
|
||||||
|
"active": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "src\\modules\\exec\\EspCam",
|
||||||
|
"active": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "src\\modules\\exec\\IarduinoRTC",
|
||||||
|
"active": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "src\\modules\\exec\\IoTServo",
|
||||||
|
"active": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "src\\modules\\exec\\Mcp23017",
|
||||||
|
"active": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "src\\modules\\exec\\Mp3",
|
||||||
|
"active": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "src\\modules\\exec\\Pwm32",
|
||||||
|
"active": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "src\\modules\\exec\\Pwm8266",
|
||||||
|
"active": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "src\\modules\\exec\\SDcard",
|
||||||
|
"active": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "src\\modules\\exec\\SysExt",
|
||||||
|
"active": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "src\\modules\\exec\\Telegram",
|
||||||
|
"active": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Экраны": [
|
||||||
|
{
|
||||||
|
"path": "src\\modules\\display\\Lcd2004",
|
||||||
"active": true
|
"active": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -50,10 +50,6 @@ lib_deps_external =
|
|||||||
|
|
||||||
[env:esp8266_4mb_fromitems]
|
[env:esp8266_4mb_fromitems]
|
||||||
lib_deps =
|
lib_deps =
|
||||||
marcoschwartz/LiquidCrystal_I2C@^1.1.4
|
|
||||||
adafruit/Adafruit MCP23017 Arduino Library@^2.0.2
|
|
||||||
adafruit/Adafruit BusIO @ ^1.13.0
|
|
||||||
dfrobot/DFRobotDFPlayerMini @ ^1.0.5
|
|
||||||
Adafruit AHTX0
|
Adafruit AHTX0
|
||||||
adafruit/Adafruit BME280 Library
|
adafruit/Adafruit BME280 Library
|
||||||
adafruit/Adafruit BMP280 Library
|
adafruit/Adafruit BMP280 Library
|
||||||
@@ -65,16 +61,13 @@ lib_deps =
|
|||||||
rc-switch @ ^2.6.4
|
rc-switch @ ^2.6.4
|
||||||
robtillaart/SHT2x@^0.1.1
|
robtillaart/SHT2x@^0.1.1
|
||||||
WEMOS SHT3x@1.0.0
|
WEMOS SHT3x@1.0.0
|
||||||
|
adafruit/Adafruit MCP23017 Arduino Library@^2.0.2
|
||||||
|
adafruit/Adafruit BusIO @ ^1.13.0
|
||||||
|
dfrobot/DFRobotDFPlayerMini @ ^1.0.5
|
||||||
|
marcoschwartz/LiquidCrystal_I2C@^1.1.4
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
+<modules\display\Lcd2004>
|
+<modules\virtual\Timer>
|
||||||
+<modules\exec\ButtonIn>
|
+<modules\virtual\Variable>
|
||||||
+<modules\exec\ButtonOut>
|
|
||||||
+<modules\exec\IarduinoRTC>
|
|
||||||
+<modules\exec\IoTServo>
|
|
||||||
+<modules\exec\Mcp23017>
|
|
||||||
+<modules\exec\Mp3>
|
|
||||||
+<modules\exec\Pwm8266>
|
|
||||||
+<modules\exec\SysExt>
|
|
||||||
+<modules\sensors\Aht20>
|
+<modules\sensors\Aht20>
|
||||||
+<modules\sensors\AnalogAdc>
|
+<modules\sensors\AnalogAdc>
|
||||||
+<modules\sensors\Bme280>
|
+<modules\sensors\Bme280>
|
||||||
@@ -88,8 +81,15 @@ build_src_filter =
|
|||||||
+<modules\sensors\Sht20>
|
+<modules\sensors\Sht20>
|
||||||
+<modules\sensors\Sht30>
|
+<modules\sensors\Sht30>
|
||||||
+<modules\sensors\Sonar>
|
+<modules\sensors\Sonar>
|
||||||
+<modules\virtual\Timer>
|
+<modules\exec\ButtonIn>
|
||||||
+<modules\virtual\Variable>
|
+<modules\exec\ButtonOut>
|
||||||
|
+<modules\exec\IarduinoRTC>
|
||||||
|
+<modules\exec\IoTServo>
|
||||||
|
+<modules\exec\Mcp23017>
|
||||||
|
+<modules\exec\Mp3>
|
||||||
|
+<modules\exec\Pwm8266>
|
||||||
|
+<modules\exec\SysExt>
|
||||||
|
+<modules\display\Lcd2004>
|
||||||
|
|
||||||
[env:esp32_4mb_fromitems]
|
[env:esp32_4mb_fromitems]
|
||||||
lib_deps =
|
lib_deps =
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
#include "ESPConfiguration.h"
|
#include "ESPConfiguration.h"
|
||||||
|
|
||||||
void* getAPI_Lcd2004(String subtype, String params);
|
void* getAPI_Timer(String subtype, String params);
|
||||||
void* getAPI_ButtonIn(String subtype, String params);
|
void* getAPI_Variable(String subtype, String params);
|
||||||
void* getAPI_ButtonOut(String subtype, String params);
|
|
||||||
void* getAPI_IarduinoRTC(String subtype, String params);
|
|
||||||
void* getAPI_IoTServo(String subtype, String params);
|
|
||||||
void* getAPI_Mcp23017(String subtype, String params);
|
|
||||||
void* getAPI_Mp3(String subtype, String params);
|
|
||||||
void* getAPI_Pwm8266(String subtype, String params);
|
|
||||||
void* getAPI_SysExt(String subtype, String params);
|
|
||||||
void* getAPI_Aht20(String subtype, String params);
|
void* getAPI_Aht20(String subtype, String params);
|
||||||
void* getAPI_AnalogAdc(String subtype, String params);
|
void* getAPI_AnalogAdc(String subtype, String params);
|
||||||
void* getAPI_Bme280(String subtype, String params);
|
void* getAPI_Bme280(String subtype, String params);
|
||||||
@@ -22,20 +15,20 @@ void* getAPI_RCswitch(String subtype, String params);
|
|||||||
void* getAPI_Sht20(String subtype, String params);
|
void* getAPI_Sht20(String subtype, String params);
|
||||||
void* getAPI_Sht30(String subtype, String params);
|
void* getAPI_Sht30(String subtype, String params);
|
||||||
void* getAPI_Sonar(String subtype, String params);
|
void* getAPI_Sonar(String subtype, String params);
|
||||||
void* getAPI_Timer(String subtype, String params);
|
void* getAPI_ButtonIn(String subtype, String params);
|
||||||
void* getAPI_Variable(String subtype, String params);
|
void* getAPI_ButtonOut(String subtype, String params);
|
||||||
|
void* getAPI_IarduinoRTC(String subtype, String params);
|
||||||
|
void* getAPI_IoTServo(String subtype, String params);
|
||||||
|
void* getAPI_Mcp23017(String subtype, String params);
|
||||||
|
void* getAPI_Mp3(String subtype, String params);
|
||||||
|
void* getAPI_Pwm8266(String subtype, String params);
|
||||||
|
void* getAPI_SysExt(String subtype, String params);
|
||||||
|
void* getAPI_Lcd2004(String subtype, String params);
|
||||||
|
|
||||||
void* getAPI(String subtype, String params) {
|
void* getAPI(String subtype, String params) {
|
||||||
void* tmpAPI;
|
void* tmpAPI;
|
||||||
if ((tmpAPI = getAPI_Lcd2004(subtype, params)) != nullptr) return tmpAPI;
|
if ((tmpAPI = getAPI_Timer(subtype, params)) != nullptr) return tmpAPI;
|
||||||
if ((tmpAPI = getAPI_ButtonIn(subtype, params)) != nullptr) return tmpAPI;
|
if ((tmpAPI = getAPI_Variable(subtype, params)) != nullptr) return tmpAPI;
|
||||||
if ((tmpAPI = getAPI_ButtonOut(subtype, params)) != nullptr) return tmpAPI;
|
|
||||||
if ((tmpAPI = getAPI_IarduinoRTC(subtype, params)) != nullptr) return tmpAPI;
|
|
||||||
if ((tmpAPI = getAPI_IoTServo(subtype, params)) != nullptr) return tmpAPI;
|
|
||||||
if ((tmpAPI = getAPI_Mcp23017(subtype, params)) != nullptr) return tmpAPI;
|
|
||||||
if ((tmpAPI = getAPI_Mp3(subtype, params)) != nullptr) return tmpAPI;
|
|
||||||
if ((tmpAPI = getAPI_Pwm8266(subtype, params)) != nullptr) return tmpAPI;
|
|
||||||
if ((tmpAPI = getAPI_SysExt(subtype, params)) != nullptr) return tmpAPI;
|
|
||||||
if ((tmpAPI = getAPI_Aht20(subtype, params)) != nullptr) return tmpAPI;
|
if ((tmpAPI = getAPI_Aht20(subtype, params)) != nullptr) return tmpAPI;
|
||||||
if ((tmpAPI = getAPI_AnalogAdc(subtype, params)) != nullptr) return tmpAPI;
|
if ((tmpAPI = getAPI_AnalogAdc(subtype, params)) != nullptr) return tmpAPI;
|
||||||
if ((tmpAPI = getAPI_Bme280(subtype, params)) != nullptr) return tmpAPI;
|
if ((tmpAPI = getAPI_Bme280(subtype, params)) != nullptr) return tmpAPI;
|
||||||
@@ -49,7 +42,14 @@ if ((tmpAPI = getAPI_RCswitch(subtype, params)) != nullptr) return tmpAPI;
|
|||||||
if ((tmpAPI = getAPI_Sht20(subtype, params)) != nullptr) return tmpAPI;
|
if ((tmpAPI = getAPI_Sht20(subtype, params)) != nullptr) return tmpAPI;
|
||||||
if ((tmpAPI = getAPI_Sht30(subtype, params)) != nullptr) return tmpAPI;
|
if ((tmpAPI = getAPI_Sht30(subtype, params)) != nullptr) return tmpAPI;
|
||||||
if ((tmpAPI = getAPI_Sonar(subtype, params)) != nullptr) return tmpAPI;
|
if ((tmpAPI = getAPI_Sonar(subtype, params)) != nullptr) return tmpAPI;
|
||||||
if ((tmpAPI = getAPI_Timer(subtype, params)) != nullptr) return tmpAPI;
|
if ((tmpAPI = getAPI_ButtonIn(subtype, params)) != nullptr) return tmpAPI;
|
||||||
if ((tmpAPI = getAPI_Variable(subtype, params)) != nullptr) return tmpAPI;
|
if ((tmpAPI = getAPI_ButtonOut(subtype, params)) != nullptr) return tmpAPI;
|
||||||
|
if ((tmpAPI = getAPI_IarduinoRTC(subtype, params)) != nullptr) return tmpAPI;
|
||||||
|
if ((tmpAPI = getAPI_IoTServo(subtype, params)) != nullptr) return tmpAPI;
|
||||||
|
if ((tmpAPI = getAPI_Mcp23017(subtype, params)) != nullptr) return tmpAPI;
|
||||||
|
if ((tmpAPI = getAPI_Mp3(subtype, params)) != nullptr) return tmpAPI;
|
||||||
|
if ((tmpAPI = getAPI_Pwm8266(subtype, params)) != nullptr) return tmpAPI;
|
||||||
|
if ((tmpAPI = getAPI_SysExt(subtype, params)) != nullptr) return tmpAPI;
|
||||||
|
if ((tmpAPI = getAPI_Lcd2004(subtype, params)) != nullptr) return tmpAPI;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user