Skip to content

Commit

Permalink
Ok, much better
Browse files Browse the repository at this point in the history
in fact, switchrule is meanfull only for autoupdate ...
if autoupdate is off, it is module's responsability to ensure switch behaviour
i think it's logic ...
  • Loading branch information
gehelem committed Dec 6, 2024
1 parent 24c2e6b commit 1b65271
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion libs/basemodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ void Basemodule::OnExternalEvent(const QString &pEventType, const QString &pEve
}
if (getEltBase(keyprop, keyelt)->getType() == "bool")
{
getEltBool(keyprop, keyelt)->setValue(v.toBool(), true);
//a boolean need to be updated on property level because of SwitchRule's flag behaviour
getProperty(keyprop)->setElt(keyelt, v);

}
if (getEltBase(keyprop, keyelt)->getType() == "date")
{
Expand Down
2 changes: 1 addition & 1 deletion libs/model/property/propertymulti.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ bool PropertyMulti::setElt(QString key, QVariant val)
return true;

}
sendError("PropertyMulti::setValue - " + key + " - OneOfMany - can't just unset");
sendWarning("PropertyMulti::setValue - " + key + " - OneOfMany - can't just unset");
return false;
break;
case AtMostOne:
Expand Down
2 changes: 1 addition & 1 deletion src/modules/dummy/dummy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void Dummy::OnMyExternalEvent(const QString &eventType, const QString &eventMod
// test max gridlimit
getProperty("secondtestgrid")->clearGrid();
getProperty("secondtestgrid")->setGridLimit(1010);
for ( int i = 0; i < 1010; i++)getProperty("secondtestgrid")->push();
//for ( int i = 0; i < 1010; i++)getProperty("secondtestgrid")->push();
}
}
if (keyprop == "devices")
Expand Down

0 comments on commit 1b65271

Please sign in to comment.