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 {
|
||||
if (value.length() == 0) {
|
||||
return false;
|
||||
}
|
||||
if (name.compare("house") == 0) {
|
||||
if (isSelflearning()) {
|
||||
return intHouse == atoi(value.c_str());
|
||||
|
|
|
@ -523,6 +523,9 @@ void TelldusCore::Manager::processMessage(const std::string & message) {
|
|||
}
|
||||
bool found = true;
|
||||
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)) {
|
||||
found = false;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue