feat: added mDNS settings

This commit is contained in:
Yurii
2025-02-15 00:05:10 +03:00
parent 0c778d4c7f
commit bb7c3eeba3
8 changed files with 48 additions and 6 deletions

View File

@@ -440,6 +440,7 @@ void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
portal[FPSTR(S_AUTH)] = src.portal.auth;
portal[FPSTR(S_LOGIN)] = src.portal.login;
portal[FPSTR(S_PASSWORD)] = src.portal.password;
portal[FPSTR(S_MDNS)] = src.portal.mdns;
auto opentherm = dst[FPSTR(S_OPENTHERM)].to<JsonObject>();
opentherm[FPSTR(S_UNIT_SYSTEM)] = static_cast<uint8_t>(src.opentherm.unitSystem);
@@ -707,6 +708,15 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
changed = true;
}
if (src[FPSTR(S_PORTAL)][FPSTR(S_MDNS)].is<bool>()) {
bool value = src[FPSTR(S_PORTAL)][FPSTR(S_MDNS)].as<bool>();
if (value != dst.portal.mdns) {
dst.portal.mdns = value;
changed = true;
}
}
// opentherm
if (!src[FPSTR(S_OPENTHERM)][FPSTR(S_UNIT_SYSTEM)].isNull()) {