Commit d3965293 authored by Michael Ott's avatar Michael Ott

Ignore disabled sensors in PluginManager::checkTopics()

parent 25c554c8
......@@ -271,15 +271,17 @@ bool PluginManager::checkTopics(const pusherPlugin_t &p) {
bool validTopics = true;
for (const auto &g : p.configurator->getSensorGroups()) {
if (!mqttCheck.checkGroup(g->getGroupName())) {
validTopics = false;
}
for (const auto &s : g->acquireSensors()) {
if (!mqttCheck.checkTopic(s->getMqtt()) || !mqttCheck.checkName(s->getName())) {
if (!g->isDisabled()) {
if (!mqttCheck.checkGroup(g->getGroupName())) {
validTopics = false;
}
for (const auto &s : g->acquireSensors()) {
if (!mqttCheck.checkTopic(s->getMqtt()) || !mqttCheck.checkName(s->getName())) {
validTopics = false;
}
}
g->releaseSensors();
}
g->releaseSensors();
}
return validTopics;
......
......@@ -98,7 +98,7 @@ class SensorGroupInterface {
const std::string &getGroupName() const { return _groupName; }
const std::string &getMqttPart() const { return _mqttPart; }
bool getSync() const { return _sync; }
bool isDisabled() const { return _disabled; }
virtual bool isDisabled() const { return _disabled; }
unsigned getMinValues() const { return _minValues; }
unsigned getInterval() const { return _interval; }
///@}
......
......@@ -78,7 +78,8 @@ class SensorGroupTemplateEntity : public SensorGroupTemplate<S> {
return *this;
}
bool isDisabled() const final override { return _disabled || _entity->isDisabled(); };
void setEntity(E *entity) { _entity = entity; }
E *const getEntity() const { return _entity; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment