Merge branch 'dev' into core3

This commit is contained in:
MichaelDvP
2026-07-12 16:40:45 +02:00
7 changed files with 21 additions and 6 deletions

View File

@@ -537,11 +537,13 @@ bool AnalogSensor::update(uint8_t gpio, const char * org_name, double offset, do
if (deleted) {
LOG_DEBUG("Removing analog sensor GPIO %02d", gpio);
EMSESP::system_.remove_gpio(gpio); // remove from used list only
EMSESP::nvs_.remove(AnalogCustomization.name);
if (EMSESP::nvs_.isKey(AnalogCustomization.name)) {
EMSESP::nvs_.remove(AnalogCustomization.name);
}
settings.analogCustomizations.remove(AnalogCustomization);
} else {
// update existing record
if (!strcmp(name, AnalogCustomization.name)) {
if (!strcmp(name, AnalogCustomization.name) && EMSESP::nvs_.isKey(AnalogCustomization.name)) {
EMSESP::nvs_.remove(AnalogCustomization.name);
}
strlcpy(AnalogCustomization.name, name, sizeof(AnalogCustomization.name));

View File

@@ -1799,8 +1799,8 @@ void EMSESP::start() {
// this will also handle any MQTT subscriptions
webCustomizationService.begin(); // load the customizations
webCommandService.begin(); // load the user commands
webSchedulerService.begin(); // load the scheduler events
webCustomEntityService.begin(); // load the custom telegram reads
webSchedulerService.begin(); // load the scheduler events
// perform any system upgrades
if (!factory_settings) {

View File

@@ -862,6 +862,7 @@ std::string compute(const std::string & expr) {
}
result = json.as<std::string>();
}
expr_new.replace(f, e - f, result.c_str());
}
}
expr_new.replace(f, e - f, result);

View File

@@ -1958,7 +1958,9 @@ bool System::get_value_info(JsonObject output, const char * cmd) {
LOG_ERROR("empty system command");
return false;
}
if (!strcmp(cmd, "restart")) { // restart is a command, not an entity
return false;
}
// check for hardcoded "info"/"value"
if (!strcmp(cmd, F_(info)) || !strcmp(cmd, F_(values))) {
return command_info("", 0, output);

View File

@@ -77,7 +77,9 @@ StateUpdateResult WebCustomEntity::update(JsonObject root, WebCustomEntity & web
if (entityItem.ram == 2) { // NVS
char key[sizeof(entityItem.name) + 2];
snprintf(key, sizeof(key), "c:%s", entityItem.name);
EMSESP::nvs_.remove(key);
if (EMSESP::nvs_.isKey(key)) {
EMSESP::nvs_.remove(key);
}
}
if (entityItem.ram) { // save name/value pairs for change checking
doc[entityItem.name] = entityItem.value;

View File

@@ -370,6 +370,10 @@ void WebSchedulerService::loop() {
if (scheduleItems_->empty()) {
return;
}
// do not execute any command in the first 60 secondes
if (uuid::get_uptime_sec() < 60) {
return;
}
// check if we have onChange events
while (!cmd_changed_.empty()) {