From 8799015f59118bce586e7b26a38eb1e5b4869d4e Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sat, 10 Jan 2026 16:06:43 +0100 Subject: [PATCH 1/2] fix board change ignore old gpio settings --- src/web/WebSettingsService.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/web/WebSettingsService.cpp b/src/web/WebSettingsService.cpp index f5dc9d831..bb82b13e7 100644 --- a/src/web/WebSettingsService.cpp +++ b/src/web/WebSettingsService.cpp @@ -308,9 +308,9 @@ StateUpdateResult WebSettings::update(JsonObject root, WebSettings & settings) { } // save the settings if changed from the webUI - // if we encountered an invalid GPIO, rollback changes and don't save settings, and report the error to WebUI + // if we encountered an invalid GPIO on same boardprofile, rollback changes and don't save settings, and report the error to WebUI // without a restart - if (!have_valid_gpios) { + if (!have_valid_gpios && original_settings.board_profile == settings.board_profile) { // replace settings with original settings settings = original_settings; EMSESP::system_.restore_snapshot_gpios(used_gpios, system_gpios); From 6fc3bf30b66a6a7108fba767b374c4dad7ebe216 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sat, 10 Jan 2026 18:19:14 +0100 Subject: [PATCH 2/2] HA uom `L`, formatting --- src/core/mqtt.cpp | 2 ++ src/web/WebSettingsService.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/mqtt.cpp b/src/core/mqtt.cpp index 0375f1374..3f6273ddb 100644 --- a/src/core/mqtt.cpp +++ b/src/core/mqtt.cpp @@ -1167,6 +1167,8 @@ void Mqtt::add_ha_classes(JsonObject doc, const uint8_t device_type, const uint8 doc[uom_ha] = "L/min"; } else if (uom == DeviceValueUOM::LH) { doc[uom_ha] = "L/h"; + } else if (uom == DeviceValueUOM::L) { + doc[uom_ha] = "L"; } else if (uom != DeviceValueUOM::NONE) { doc[uom_ha] = EMSdevice::uom_to_string(uom); // use default } else if (discovery_type() != discoveryType::HOMEASSISTANT) { diff --git a/src/web/WebSettingsService.cpp b/src/web/WebSettingsService.cpp index bb82b13e7..b242567dd 100644 --- a/src/web/WebSettingsService.cpp +++ b/src/web/WebSettingsService.cpp @@ -308,8 +308,8 @@ StateUpdateResult WebSettings::update(JsonObject root, WebSettings & settings) { } // save the settings if changed from the webUI - // if we encountered an invalid GPIO on same boardprofile, rollback changes and don't save settings, and report the error to WebUI - // without a restart + // if we encountered an invalid GPIO on same boardprofile, rollback changes and don't save settings, + // and report the error to WebUI without a restart if (!have_valid_gpios && original_settings.board_profile == settings.board_profile) { // replace settings with original settings settings = original_settings;