Merge branch 'emsesp:dev' into dev

This commit is contained in:
Proddy
2026-01-10 18:39:48 +01:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -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) {

View File

@@ -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
// without a restart
if (!have_valid_gpios) {
// 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;
EMSESP::system_.restore_snapshot_gpios(used_gpios, system_gpios);