fix virtual function not being called
This commit is contained in:
parent
65f7919ed9
commit
acf009dbe8
@ -42,7 +42,7 @@ namespace Ha {
|
|||||||
this->f = f;
|
this->f = f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void buildConfig(JsonDocument& jsonDoc) {
|
void buildConfig(JsonDocument& jsonDoc) override {
|
||||||
Component::buildConfig(jsonDoc);
|
Component::buildConfig(jsonDoc);
|
||||||
jsonDoc["command_topic"] = commandTopic;
|
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") {
|
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);
|
Component::buildConfig(jsonDoc);
|
||||||
jsonDoc["device_class"] = deviceClass;
|
jsonDoc["device_class"] = deviceClass;
|
||||||
jsonDoc["unit_of_measurement"] = unitMeasure;
|
jsonDoc["unit_of_measurement"] = unitMeasure;
|
||||||
|
|||||||
@ -86,10 +86,10 @@ namespace Mqtt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void publishConfig() {
|
void publishConfig() {
|
||||||
for (Ha::Component cmp : sensors) {
|
for (Ha::Component& cmp : sensors) {
|
||||||
publishComponentConfig(cmp);
|
publishComponentConfig(cmp);
|
||||||
}
|
}
|
||||||
for (Ha::Component cmp : switches) {
|
for (Ha::Component& cmp : switches) {
|
||||||
publishComponentConfig(cmp);
|
publishComponentConfig(cmp);
|
||||||
}
|
}
|
||||||
ts.deleteTask(tPublishConfig);
|
ts.deleteTask(tPublishConfig);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user