mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
Merge branch 'dev' of https://github.com/emsesp/EMS-ESP32 into dev2
This commit is contained in:
@@ -20,3 +20,4 @@
|
|||||||
- use flag for BC400 compatible thermostats, manage different mode settings
|
- use flag for BC400 compatible thermostats, manage different mode settings
|
||||||
- use factory partition for 16M flash
|
- use factory partition for 16M flash
|
||||||
- store digital out states to nvs
|
- store digital out states to nvs
|
||||||
|
- Refresh UI - moving settings to one location [#1665](https://github.com/emsesp/EMS-ESP32/issues/1665)
|
||||||
|
|||||||
@@ -1326,18 +1326,18 @@ void Mqtt::add_ha_sections_to_doc(const char * name,
|
|||||||
JsonArray avty = config["avty"].to<JsonArray>();
|
JsonArray avty = config["avty"].to<JsonArray>();
|
||||||
JsonDocument avty_json;
|
JsonDocument avty_json;
|
||||||
|
|
||||||
const char * tpl_draft = "{{'online' if %s else 'offline'}}";
|
|
||||||
|
|
||||||
char tpl[150];
|
char tpl[150];
|
||||||
|
|
||||||
|
// skip conditional Jinja2 templates if not home assistant
|
||||||
|
if (discovery_type() == discoveryType::HOMEASSISTANT) {
|
||||||
// EMS-ESP status check
|
// EMS-ESP status check
|
||||||
// snprintf(tpl, sizeof(tpl), "%s/status", Mqtt::base().c_str());
|
// snprintf(tpl, sizeof(tpl), "%s/status", Mqtt::base().c_str());
|
||||||
// avty_json["t"] = tpl;
|
// avty_json["t"] = tpl;
|
||||||
// snprintf(tpl, sizeof(tpl), tpl_draft, "value == 'online'");
|
// snprintf(tpl, sizeof(tpl), tpl_draft, "value == 'online'");
|
||||||
// avty_json["val_tpl"] = tpl;
|
// avty_json["val_tpl"] = tpl;
|
||||||
// avty.add(avty_json); // returns 0 if no mem
|
// avty.add(avty_json); // returns 0 if no mem
|
||||||
|
const char * tpl_draft = "{{'online' if %s else 'offline'}}";
|
||||||
|
|
||||||
// skip conditional Jinja2 templates if not home assistant
|
|
||||||
if (discovery_type() == discoveryType::HOMEASSISTANT) {
|
|
||||||
// condition 1
|
// condition 1
|
||||||
avty_json.clear();
|
avty_json.clear();
|
||||||
avty_json["t"] = state_t;
|
avty_json["t"] = state_t;
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ StateUpdateResult WebCustomEntity::update(JsonObject root, WebCustomEntity & web
|
|||||||
if (root["entities"].is<JsonArray>()) {
|
if (root["entities"].is<JsonArray>()) {
|
||||||
for (const JsonObject ei : root["entities"].as<JsonArray>()) {
|
for (const JsonObject ei : root["entities"].as<JsonArray>()) {
|
||||||
auto entityItem = CustomEntityItem();
|
auto entityItem = CustomEntityItem();
|
||||||
entityItem.ram = ei["ram"] | 0;
|
entityItem.ram = ei["ram"];
|
||||||
entityItem.device_id = ei["device_id"]; // send as numeric, will be converted to string in web
|
entityItem.device_id = ei["device_id"]; // send as numeric, will be converted to string in web
|
||||||
entityItem.type_id = ei["type_id"];
|
entityItem.type_id = ei["type_id"];
|
||||||
entityItem.offset = ei["offset"];
|
entityItem.offset = ei["offset"];
|
||||||
|
|||||||
Reference in New Issue
Block a user