3 Commits

Author SHA1 Message Date
Yurii
b53dae6a43 fix: `inputmode` attribute fixed for float settings #117 2024-12-31 01:48:44 +03:00
Yurii
de2318bc6a refactor: compatibility with ArduinoJson 7.3.0 2024-12-30 23:12:31 +03:00
Yurii
081209420a chore: bump bblanchon/ArduinoJson from 7.1.0 to 7.3.0 2024-12-30 23:11:14 +03:00
4 changed files with 21 additions and 21 deletions

View File

@@ -17,7 +17,7 @@ core_dir = .pio
version = 1.5.0 version = 1.5.0
framework = arduino framework = arduino
lib_deps = lib_deps =
bblanchon/ArduinoJson@^7.1.0 bblanchon/ArduinoJson@^7.3.0
;ihormelnyk/OpenTherm Library@^1.1.5 ;ihormelnyk/OpenTherm Library@^1.1.5
https://github.com/ihormelnyk/opentherm_library#master https://github.com/ihormelnyk/opentherm_library#master
;arduino-libraries/ArduinoMqttClient@^0.1.8 ;arduino-libraries/ArduinoMqttClient@^0.1.8

View File

@@ -181,7 +181,7 @@ public:
if (sSensor.type == Sensors::Type::BLUETOOTH) { if (sSensor.type == Sensors::Type::BLUETOOTH) {
// available state topic // available state topic
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = doc[FPSTR(HA_STATE_TOPIC)]; doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = doc[FPSTR(HA_STATE_TOPIC)];
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = AVAILABILITY_SENSOR_CONN; doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_SENSOR_CONN, true);
String sName = sSensor.name; String sName = sSensor.name;
switch (vType) { switch (vType) {
@@ -254,7 +254,7 @@ public:
} else { } else {
// available state topic // available state topic
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = doc[FPSTR(HA_STATE_TOPIC)]; doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = doc[FPSTR(HA_STATE_TOPIC)];
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = AVAILABILITY_SENSOR_CONN; doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_SENSOR_CONN, true);
doc[FPSTR(HA_NAME)] = sSensor.name; doc[FPSTR(HA_NAME)] = sSensor.name;
doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.value|float(0)|round(2) }}"); doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.value|float(0)|round(2) }}");
@@ -970,7 +970,7 @@ public:
JsonDocument doc; JsonDocument doc;
doc[FPSTR(HA_AVAILABILITY)][0][FPSTR(HA_TOPIC)] = this->statusTopic.c_str(); doc[FPSTR(HA_AVAILABILITY)][0][FPSTR(HA_TOPIC)] = this->statusTopic.c_str();
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = this->stateTopic.c_str(); doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = this->stateTopic.c_str();
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = AVAILABILITY_OT_CONN; doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true);
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all"); doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("heating")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("heating"));
@@ -991,7 +991,7 @@ public:
JsonDocument doc; JsonDocument doc;
doc[FPSTR(HA_AVAILABILITY)][0][FPSTR(HA_TOPIC)] = this->statusTopic.c_str(); doc[FPSTR(HA_AVAILABILITY)][0][FPSTR(HA_TOPIC)] = this->statusTopic.c_str();
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = this->stateTopic.c_str(); doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = this->stateTopic.c_str();
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = AVAILABILITY_OT_CONN; doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true);
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all"); doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("dhw")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("dhw"));
@@ -1012,7 +1012,7 @@ public:
JsonDocument doc; JsonDocument doc;
doc[FPSTR(HA_AVAILABILITY)][0][FPSTR(HA_TOPIC)] = this->statusTopic.c_str(); doc[FPSTR(HA_AVAILABILITY)][0][FPSTR(HA_TOPIC)] = this->statusTopic.c_str();
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = this->stateTopic.c_str(); doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = this->stateTopic.c_str();
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = AVAILABILITY_OT_CONN; doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true);
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all"); doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("flame")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("flame"));
@@ -1033,7 +1033,7 @@ public:
JsonDocument doc; JsonDocument doc;
doc[FPSTR(HA_AVAILABILITY)][0][FPSTR(HA_TOPIC)] = this->statusTopic.c_str(); doc[FPSTR(HA_AVAILABILITY)][0][FPSTR(HA_TOPIC)] = this->statusTopic.c_str();
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = this->stateTopic.c_str(); doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = this->stateTopic.c_str();
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = AVAILABILITY_OT_CONN; doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true);
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all"); doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("fault")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("fault"));
@@ -1054,7 +1054,7 @@ public:
JsonDocument doc; JsonDocument doc;
doc[FPSTR(HA_AVAILABILITY)][0][FPSTR(HA_TOPIC)] = this->statusTopic.c_str(); doc[FPSTR(HA_AVAILABILITY)][0][FPSTR(HA_TOPIC)] = this->statusTopic.c_str();
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = this->stateTopic.c_str(); doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = this->stateTopic.c_str();
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = AVAILABILITY_OT_CONN; doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true);
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all"); doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC)); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC));

View File

@@ -134,12 +134,12 @@
<div class="grid"> <div class="grid">
<label> <label>
<span data-i18n>sensors.correction.offset</span> <span data-i18n>sensors.correction.offset</span>
<input type="number" inputmode="numeric" name="offset" min="-20" max="20" step="0.01" required> <input type="number" inputmode="decimal" name="offset" min="-20" max="20" step="0.01" required>
</label> </label>
<label> <label>
<span data-i18n>sensors.correction.factor</span> <span data-i18n>sensors.correction.factor</span>
<input type="number" inputmode="numeric" name="factor" min="0.01" max="10" step="0.01" required> <input type="number" inputmode="decimal" name="factor" min="0.01" max="10" step="0.01" required>
</label> </label>
</div> </div>
</details> </details>
@@ -159,7 +159,7 @@
<label> <label>
<span data-i18n>sensors.filtering.factor.title</span> <span data-i18n>sensors.filtering.factor.title</span>
<input type="number" inputmode="numeric" name="filteringFactor" min="0.01" max="1" step="0.01"> <input type="number" inputmode="decimal" name="filteringFactor" min="0.01" max="1" step="0.01">
<small data-i18n>sensors.filtering.factor.note</small> <small data-i18n>sensors.filtering.factor.note</small>
</label> </label>
</div> </div>

View File

@@ -170,12 +170,12 @@
<div class="grid"> <div class="grid">
<label> <label>
<span data-i18n>settings.heating.hyst</span> <span data-i18n>settings.heating.hyst</span>
<input type="number" inputmode="numeric" name="heating[hysteresis]" min="0" max="5" step="0.05" required> <input type="number" inputmode="decimal" name="heating[hysteresis]" min="0" max="5" step="0.05" required>
</label> </label>
<label> <label>
<span data-i18n>settings.heating.turboFactor</span> <span data-i18n>settings.heating.turboFactor</span>
<input type="number" inputmode="numeric" name="heating[turboFactor]" min="1.5" max="10" step="0.1" required> <input type="number" inputmode="decimal" name="heating[turboFactor]" min="1.5" max="10" step="0.1" required>
</label> </label>
</div> </div>
@@ -254,17 +254,17 @@
<div class="grid"> <div class="grid">
<label> <label>
<span data-i18n>settings.equitherm.n</span> <span data-i18n>settings.equitherm.n</span>
<input type="number" inputmode="numeric" name="equitherm[n_factor]" min="0.001" max="10" step="0.001" required> <input type="number" inputmode="decimal" name="equitherm[n_factor]" min="0.001" max="10" step="0.001" required>
</label> </label>
<label> <label>
<span data-i18n>settings.equitherm.k</span> <span data-i18n>settings.equitherm.k</span>
<input type="number" inputmode="numeric" name="equitherm[k_factor]" min="0" max="10" step="0.01" required> <input type="number" inputmode="decimal" name="equitherm[k_factor]" min="0" max="10" step="0.01" required>
</label> </label>
<label> <label>
<span data-i18n>settings.equitherm.t.title</span> <span data-i18n>settings.equitherm.t.title</span>
<input type="number" inputmode="numeric" name="equitherm[t_factor]" min="0" max="10" step="0.01" required> <input type="number" inputmode="decimal" name="equitherm[t_factor]" min="0" max="10" step="0.01" required>
<small data-i18n>settings.equitherm.t.note</small> <small data-i18n>settings.equitherm.t.note</small>
</label> </label>
</div> </div>
@@ -291,17 +291,17 @@
<div class="grid"> <div class="grid">
<label> <label>
<span data-i18n>settings.pid.p</span> <span data-i18n>settings.pid.p</span>
<input type="number" inputmode="numeric" name="pid[p_factor]" min="0.1" max="1000" step="0.01" required> <input type="number" inputmode="decimal" name="pid[p_factor]" min="0.1" max="1000" step="0.01" required>
</label> </label>
<label> <label>
<span data-i18n>settings.pid.i</span> <span data-i18n>settings.pid.i</span>
<input type="number" inputmode="numeric" name="pid[i_factor]" min="0" max="100" step="0.0001" required> <input type="number" inputmode="decimal" name="pid[i_factor]" min="0" max="100" step="0.0001" required>
</label> </label>
<label> <label>
<span data-i18n>settings.pid.d</span> <span data-i18n>settings.pid.d</span>
<input type="number" inputmode="numeric" name="pid[d_factor]" min="0" max="100000" step="0.1" required> <input type="number" inputmode="decimal" name="pid[d_factor]" min="0" max="100000" step="0.1" required>
</label> </label>
</div> </div>
@@ -390,13 +390,13 @@
<div class="grid"> <div class="grid">
<label> <label>
<span data-i18n>settings.ot.minPower.title</span> <span data-i18n>settings.ot.minPower.title</span>
<input type="number" inputmode="numeric" name="opentherm[minPower]" min="0" max="1000" step="0.1"> <input type="number" inputmode="decimal" name="opentherm[minPower]" min="0" max="1000" step="0.01">
<small data-i18n>settings.ot.minPower.note</small> <small data-i18n>settings.ot.minPower.note</small>
</label> </label>
<label> <label>
<span data-i18n>settings.ot.maxPower.title</span> <span data-i18n>settings.ot.maxPower.title</span>
<input type="number" inputmode="numeric" name="opentherm[maxPower]" min="0" max="1000" step="0.1"> <input type="number" inputmode="decimal" name="opentherm[maxPower]" min="0" max="1000" step="0.01">
<small data-i18n>settings.ot.maxPower.note</small> <small data-i18n>settings.ot.maxPower.note</small>
</label> </label>
</div> </div>