Moved check for the length to Manager::parseMessage() instead of in each Device.
This commit is contained in:
parent
aa8a4f8885
commit
b3f3ef00f8
2 changed files with 3 additions and 3 deletions
|
@ -250,9 +250,6 @@ std::string DeviceNexa::getStringSelflearning(bool dim, unsigned char level) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DeviceNexa::parameterMatches( const std::string &name, const std::string &value ) const {
|
bool DeviceNexa::parameterMatches( const std::string &name, const std::string &value ) const {
|
||||||
if (value.length() == 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (name.compare("house") == 0) {
|
if (name.compare("house") == 0) {
|
||||||
if (isSelflearning()) {
|
if (isSelflearning()) {
|
||||||
return intHouse == atoi(value.c_str());
|
return intHouse == atoi(value.c_str());
|
||||||
|
|
|
@ -523,6 +523,9 @@ void TelldusCore::Manager::processMessage(const std::string & message) {
|
||||||
}
|
}
|
||||||
bool found = true;
|
bool found = true;
|
||||||
for (std::map<std::string, std::string>::const_iterator p_it = parameters.begin(); p_it != parameters.end(); ++p_it) {
|
for (std::map<std::string, std::string>::const_iterator p_it = parameters.begin(); p_it != parameters.end(); ++p_it) {
|
||||||
|
if (p_it->second.length() == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!it->second->parameterMatches(p_it->first, p_it->second)) {
|
if (!it->second->parameterMatches(p_it->first, p_it->second)) {
|
||||||
found = false;
|
found = false;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue