diff --git a/include/ha.h b/include/ha.h index e4345bb..3fd5cfb 100644 --- a/include/ha.h +++ b/include/ha.h @@ -42,7 +42,7 @@ namespace Ha { this->f = f; } - void buildConfig(JsonDocument& jsonDoc) { + void buildConfig(JsonDocument& jsonDoc) override { Component::buildConfig(jsonDoc); jsonDoc["command_topic"] = commandTopic; } @@ -76,7 +76,7 @@ namespace Ha { Sensor(const char* name, const char* uniqueId, const char* topic) : Component(name, uniqueId, topic, "sensor") { } - void buildConfig(JsonDocument& jsonDoc) { + void buildConfig(JsonDocument& jsonDoc) override { Component::buildConfig(jsonDoc); jsonDoc["device_class"] = deviceClass; jsonDoc["unit_of_measurement"] = unitMeasure; diff --git a/include/mqtt.h b/include/mqtt.h index 8848560..900506c 100644 --- a/include/mqtt.h +++ b/include/mqtt.h @@ -86,10 +86,10 @@ namespace Mqtt { } void publishConfig() { - for (Ha::Component cmp : sensors) { + for (Ha::Component& cmp : sensors) { publishComponentConfig(cmp); } - for (Ha::Component cmp : switches) { + for (Ha::Component& cmp : switches) { publishComponentConfig(cmp); } ts.deleteTask(tPublishConfig);