HA cleanup

This commit is contained in:
proddy
2021-01-21 20:24:32 +01:00
parent 94ac0d1418
commit f466453a8e
2 changed files with 3 additions and 3 deletions

View File

@@ -514,7 +514,7 @@ void Mqtt::ha_status() {
doc["uniq_id"] = FJSON("ems-esp-system"); doc["uniq_id"] = FJSON("ems-esp-system");
doc["~"] = System::hostname(); // default ems-esp doc["~"] = System::hostname(); // default ems-esp
// doc["avty_t"] = FJSON("~/status"); // commented out, as it causes errors in HA sometimes // doc["avty_t"] = FJSON("~/status"); // commented out, as it causes errors in HA sometimes
doc["json_attr_t"] = FJSON("~/heartbeat"); // doc["json_attr_t"] = FJSON("~/heartbeat"); // store also as HA attributes
doc["stat_t"] = FJSON("~/heartbeat"); doc["stat_t"] = FJSON("~/heartbeat");
doc["name"] = FJSON("EMS-ESP status"); doc["name"] = FJSON("EMS-ESP status");
doc["val_tpl"] = FJSON("{{value_json['status']}}"); doc["val_tpl"] = FJSON("{{value_json['status']}}");

View File

@@ -96,8 +96,8 @@ void Shower::send_mqtt_stat(bool state) {
return; return;
} }
char s[7]; // char s[7];
Mqtt::publish(F("shower_active"), Helpers::render_boolean(s, state)); // Mqtt::publish(F("shower_active"), Helpers::render_boolean(s, state));
// if we're in HA mode make sure we've first sent out the HA MQTT Discovery config topic // if we're in HA mode make sure we've first sent out the HA MQTT Discovery config topic
if ((Mqtt::ha_enabled()) && (!ha_configdone_)) { if ((Mqtt::ha_enabled()) && (!ha_configdone_)) {