Fix: Hint regarding required device profile is shown for profiles which don't need a device profile
This patch introduces a define which allows to specifiy for each environment if a device profile is absolutly required. Fixes #2500
This commit is contained in:
parent
220cfbf7ae
commit
571ba2f350
@ -79,6 +79,7 @@ upload_protocol = esptool
|
|||||||
[env:generic_esp32]
|
[env:generic_esp32]
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
build_flags = ${env.build_flags}
|
build_flags = ${env.build_flags}
|
||||||
|
-DPIN_MAPPING_REQUIRED=1
|
||||||
|
|
||||||
|
|
||||||
[env:generic_esp32_16mb_psram]
|
[env:generic_esp32_16mb_psram]
|
||||||
@ -87,6 +88,7 @@ board_build.flash_mode = qio
|
|||||||
board_build.partitions = partitions_custom_16mb.csv
|
board_build.partitions = partitions_custom_16mb.csv
|
||||||
board_upload.flash_size = 16MB
|
board_upload.flash_size = 16MB
|
||||||
build_flags = ${env.build_flags}
|
build_flags = ${env.build_flags}
|
||||||
|
-DPIN_MAPPING_REQUIRED=1
|
||||||
-DBOARD_HAS_PSRAM
|
-DBOARD_HAS_PSRAM
|
||||||
-mfix-esp32-psram-cache-issue
|
-mfix-esp32-psram-cache-issue
|
||||||
|
|
||||||
@ -95,6 +97,7 @@ build_flags = ${env.build_flags}
|
|||||||
board = esp32-c3-devkitc-02
|
board = esp32-c3-devkitc-02
|
||||||
custom_patches = ${env.custom_patches}
|
custom_patches = ${env.custom_patches}
|
||||||
build_flags = ${env.build_flags}
|
build_flags = ${env.build_flags}
|
||||||
|
-DPIN_MAPPING_REQUIRED=1
|
||||||
|
|
||||||
|
|
||||||
[env:generic_esp32c3_usb]
|
[env:generic_esp32c3_usb]
|
||||||
@ -103,11 +106,13 @@ custom_patches = ${env.custom_patches}
|
|||||||
build_flags = ${env.build_flags}
|
build_flags = ${env.build_flags}
|
||||||
-DARDUINO_USB_MODE=1
|
-DARDUINO_USB_MODE=1
|
||||||
-DARDUINO_USB_CDC_ON_BOOT=1
|
-DARDUINO_USB_CDC_ON_BOOT=1
|
||||||
|
-DPIN_MAPPING_REQUIRED=1
|
||||||
|
|
||||||
|
|
||||||
[env:generic_esp32s3]
|
[env:generic_esp32s3]
|
||||||
board = esp32-s3-devkitc-1
|
board = esp32-s3-devkitc-1
|
||||||
build_flags = ${env.build_flags}
|
build_flags = ${env.build_flags}
|
||||||
|
-DPIN_MAPPING_REQUIRED=1
|
||||||
|
|
||||||
|
|
||||||
[env:generic_esp32s3_usb]
|
[env:generic_esp32s3_usb]
|
||||||
@ -116,6 +121,7 @@ upload_protocol = esp-builtin
|
|||||||
build_flags = ${env.build_flags}
|
build_flags = ${env.build_flags}
|
||||||
-DARDUINO_USB_MODE=1
|
-DARDUINO_USB_MODE=1
|
||||||
-DARDUINO_USB_CDC_ON_BOOT=1
|
-DARDUINO_USB_CDC_ON_BOOT=1
|
||||||
|
-DPIN_MAPPING_REQUIRED=1
|
||||||
|
|
||||||
|
|
||||||
[env:generic]
|
[env:generic]
|
||||||
|
|||||||
@ -10,6 +10,10 @@
|
|||||||
#include "defaults.h"
|
#include "defaults.h"
|
||||||
#include <AsyncJson.h>
|
#include <AsyncJson.h>
|
||||||
|
|
||||||
|
#ifndef PIN_MAPPING_REQUIRED
|
||||||
|
#define DPIN_MAPPING_REQUIRED 0
|
||||||
|
#endif
|
||||||
|
|
||||||
WebApiWsLiveClass::WebApiWsLiveClass()
|
WebApiWsLiveClass::WebApiWsLiveClass()
|
||||||
: _ws("/livedata")
|
: _ws("/livedata")
|
||||||
, _wsCleanupTask(1 * TASK_SECOND, TASK_FOREVER, std::bind(&WebApiWsLiveClass::wsCleanupTaskCb, this))
|
, _wsCleanupTask(1 * TASK_SECOND, TASK_FOREVER, std::bind(&WebApiWsLiveClass::wsCleanupTaskCb, this))
|
||||||
@ -126,8 +130,7 @@ void WebApiWsLiveClass::generateCommonJsonResponse(JsonVariant& root)
|
|||||||
hintObj["radio_problem"] = (Hoymiles.getRadioNrf()->isInitialized() && (!Hoymiles.getRadioNrf()->isConnected() || !Hoymiles.getRadioNrf()->isPVariant())) || (Hoymiles.getRadioCmt()->isInitialized() && (!Hoymiles.getRadioCmt()->isConnected()));
|
hintObj["radio_problem"] = (Hoymiles.getRadioNrf()->isInitialized() && (!Hoymiles.getRadioNrf()->isConnected() || !Hoymiles.getRadioNrf()->isPVariant())) || (Hoymiles.getRadioCmt()->isInitialized() && (!Hoymiles.getRadioCmt()->isConnected()));
|
||||||
hintObj["default_password"] = strcmp(Configuration.get().Security.Password, ACCESS_POINT_PASSWORD) == 0;
|
hintObj["default_password"] = strcmp(Configuration.get().Security.Password, ACCESS_POINT_PASSWORD) == 0;
|
||||||
|
|
||||||
bool isGeneric = String(PIOENV) == "generic";
|
hintObj["pin_mapping_issue"] = PIN_MAPPING_REQUIRED && !PinMapping.isMappingSelected();
|
||||||
hintObj["pin_mapping_issue"] = !isGeneric && !PinMapping.isMappingSelected();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebApiWsLiveClass::generateInverterCommonJsonResponse(JsonObject& root, std::shared_ptr<InverterAbstract> inv)
|
void WebApiWsLiveClass::generateInverterCommonJsonResponse(JsonObject& root, std::shared_ptr<InverterAbstract> inv)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user