fix virtual function not being called
This commit is contained in:
parent
65f7919ed9
commit
acf009dbe8
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user