From ac7ccde2e3ee3fee25652b901143d1d1b3742ab2 Mon Sep 17 00:00:00 2001 From: Ilya Belyakov Date: Sat, 7 Oct 2023 22:50:39 +0300 Subject: [PATCH] =?UTF-8?q?=D0=93=D0=B5=D0=BD=D0=B5=D1=80=D0=B8=D1=80?= =?UTF-8?q?=D1=83=D0=B5=D0=BC=20=D1=83=D0=BA=D0=BE=D1=80=D0=BE=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=BD=D1=8B=D0=B9=20myProfile=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=BF=D0=B8=D1=81=D0=B8=20=D0=BD=D0=B0=20flash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PrepareProject.py | 17 +- data_svelte/flashProfile.json | 333 ++++++++++++++++++++++++++++++++++ 2 files changed, 346 insertions(+), 4 deletions(-) create mode 100644 data_svelte/flashProfile.json diff --git a/PrepareProject.py b/PrepareProject.py index 76261645..835898b1 100644 --- a/PrepareProject.py +++ b/PrepareProject.py @@ -206,10 +206,19 @@ config["platformio"]["default_envs"] = deviceName with open("platformio.ini", 'w') as configFile: config.write(configFile) -# сохраняем применяемый профиль в папку data_svelte для загрузки на контроллер и дальнейшего переиспользования -print(f"Saving profile {profile} in /data_svelte") -shutil.copy(profile, "data_svelte/" + profile) - + +# сохраняем часть применяемого профиля в папку data_svelte для загрузки на контроллер и дальнейшего переиспользования +print(f"Saving profile {profile} in /data_svelte/flashProfile.json") +shortProfJson = json.loads('{}') +shortProfJson['projectProp'] = { + 'platformio': { + 'default_envs': deviceName + } + } +shortProfJson['modules'] = profJson['modules'] +with open("data_svelte/flashProfile.json", "w", encoding='utf-8') as write_file: + json.dump(shortProfJson, write_file, ensure_ascii=False, indent=4, sort_keys=False) + # import ctypes # An included library with Python install. # if update: diff --git a/data_svelte/flashProfile.json b/data_svelte/flashProfile.json new file mode 100644 index 00000000..4c908db4 --- /dev/null +++ b/data_svelte/flashProfile.json @@ -0,0 +1,333 @@ +{ + "projectProp": { + "platformio": { + "default_envs": "esp8266_4mb" + } + }, + "modules": { + "virtual_elments": [ + { + "path": "src/modules/virtual/Cron", + "active": true + }, + { + "path": "src/modules/virtual/GoogleSheet", + "active": false + }, + { + "path": "src/modules/virtual/Loging", + "active": true + }, + { + "path": "src/modules/virtual/LogingDaily", + "active": true + }, + { + "path": "src/modules/virtual/owmWeather", + "active": true + }, + { + "path": "src/modules/virtual/Timer", + "active": true + }, + { + "path": "src/modules/virtual/Variable", + "active": true + }, + { + "path": "src/modules/virtual/VariableColor", + "active": true + }, + { + "path": "src/modules/virtual/VButton", + "active": true + }, + { + "path": "src/modules/virtual/Weather", + "active": false + } + ], + "sensors": [ + { + "path": "src/modules/sensors/A02Distance", + "active": true + }, + { + "path": "src/modules/sensors/Acs712", + "active": true + }, + { + "path": "src/modules/sensors/Ads1115", + "active": false + }, + { + "path": "src/modules/sensors/AhtXX", + "active": true + }, + { + "path": "src/modules/sensors/AnalogAdc", + "active": true + }, + { + "path": "src/modules/sensors/BH_1750", + "active": false + }, + { + "path": "src/modules/sensors/Ble", + "active": false + }, + { + "path": "src/modules/sensors/Bme280", + "active": true + }, + { + "path": "src/modules/sensors/Bmp280", + "active": true + }, + { + "path": "src/modules/sensors/Dht1122", + "active": true + }, + { + "path": "src/modules/sensors/Ds18b20", + "active": true + }, + { + "path": "src/modules/sensors/DS2401", + "active": false + }, + { + "path": "src/modules/sensors/Emon", + "active": false + }, + { + "path": "src/modules/sensors/ExampleModule", + "active": false + }, + { + "path": "src/modules/sensors/ExternalMQTT", + "active": false + }, + { + "path": "src/modules/sensors/FreqMeter", + "active": false + }, + { + "path": "src/modules/sensors/GY21", + "active": false + }, + { + "path": "src/modules/sensors/Hdc1080", + "active": false + }, + { + "path": "src/modules/sensors/Hx710", + "active": false + }, + { + "path": "src/modules/sensors/Hx711", + "active": false + }, + { + "path": "src/modules/sensors/Impulse", + "active": true + }, + { + "path": "src/modules/sensors/Ina219", + "active": false + }, + { + "path": "src/modules/sensors/Ina226", + "active": false + }, + { + "path": "src/modules/sensors/IoTWiegand", + "active": false + }, + { + "path": "src/modules/sensors/ld2410", + "active": false + }, + { + "path": "src/modules/sensors/Max6675", + "active": false + }, + { + "path": "src/modules/sensors/Mhz19", + "active": false + }, + { + "path": "src/modules/sensors/Ntc", + "active": false + }, + { + "path": "src/modules/sensors/Pzem004t", + "active": true + }, + { + "path": "src/modules/sensors/RCswitch", + "active": false + }, + { + "path": "src/modules/sensors/RTC", + "active": true + }, + { + "path": "src/modules/sensors/S8", + "active": true + }, + { + "path": "src/modules/sensors/Scd40", + "active": false + }, + { + "path": "src/modules/sensors/Sds011", + "active": false + }, + { + "path": "src/modules/sensors/Sgp30", + "active": false + }, + { + "path": "src/modules/sensors/Sht20", + "active": true + }, + { + "path": "src/modules/sensors/Sht30", + "active": true + }, + { + "path": "src/modules/sensors/Sonar", + "active": true + }, + { + "path": "src/modules/sensors/UART", + "active": true + } + ], + "executive_devices": [ + { + "path": "src/modules/exec/ButtonIn", + "active": true + }, + { + "path": "src/modules/exec/ButtonOut", + "active": true + }, + { + "path": "src/modules/exec/Buzzer", + "active": true + }, + { + "path": "src/modules/exec/Enconder", + "active": true + }, + { + "path": "src/modules/exec/EspCam", + "active": false + }, + { + "path": "src/modules/exec/Ftp", + "active": false + }, + { + "path": "src/modules/exec/HttpGet", + "active": false + }, + { + "path": "src/modules/exec/IoTServo", + "active": true + }, + { + "path": "src/modules/exec/Mcp23008", + "active": false + }, + { + "path": "src/modules/exec/Mcp23017", + "active": true + }, + { + "path": "src/modules/exec/Mp3", + "active": true + }, + { + "path": "src/modules/exec/Multitouch", + "active": true + }, + { + "path": "src/modules/exec/MySensors", + "active": false + }, + { + "path": "src/modules/exec/Pcf8574", + "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": false + }, + { + "path": "src/modules/exec/Telegram", + "active": false + }, + { + "path": "src/modules/exec/TelegramLT", + "active": true + }, + { + "path": "src/modules/exec/Telegram_v2", + "active": false + }, + { + "path": "src/modules/exec/Thermostat", + "active": false + }, + { + "path": "src/modules/sensors/Ds2423", + "active": false + } + ], + "screens": [ + { + "path": "src/modules/display/DwinI", + "active": false + }, + { + "path": "src/modules/display/Lcd2004", + "active": true + }, + { + "path": "src/modules/display/NextionUpload", + "active": false + }, + { + "path": "src/modules/display/Oled128", + "active": false + }, + { + "path": "src/modules/display/Smi2_m", + "active": true + }, + { + "path": "src/modules/display/TM16XX", + "active": true + }, + { + "path": "src/modules/display/Ws2812b", + "active": false + } + ] + } +} \ No newline at end of file