Holds the parameters for a RuleAction. More...
Header: | #include <RuleActionParam> |
RuleActionParam(const Param & param = Param()) | |
RuleActionParam(const ParamTypeId & paramTypeId, const QVariant & value = QVariant()) | |
RuleActionParam(const ParamTypeId & paramTypeId, const EventTypeId & eventTypeId, const ParamTypeId & eventParamTypeId) | |
RuleActionParam(const ParamTypeId & paramTypeId, const DeviceId & stateDeviceId, const StateTypeId & stateTypeId) | |
RuleActionParam(const QString & paramName, const QVariant & value = QVariant()) | |
RuleActionParam(const QString & paramName, const EventTypeId & eventTypeId, const ParamTypeId & eventParamTypeId) | |
RuleActionParam(const QString & paramName, const DeviceId & stateDeviceId, const StateTypeId & stateTypeId) | |
ParamTypeId | eventParamTypeId() const |
EventTypeId | eventTypeId() const |
bool | isEventBased() const |
bool | isStateBased() const |
bool | isValid() const |
bool | isValueBased() const |
QString | paramName() const |
ParamTypeId | paramTypeId() const |
void | setEventParamTypeId(const ParamTypeId & eventParamTypeId) |
void | setEventTypeId(const EventTypeId & eventTypeId) |
void | setStateDeviceId(const DeviceId & stateDeviceId) |
void | setStateTypeId(const StateTypeId & stateTypeId) |
void | setValue(const QVariant & value) |
DeviceId | stateDeviceId() const |
StateTypeId | stateTypeId() const |
QVariant | value() const |
Holds the parameters for a RuleAction.
A RuleActionParam allows rules to take over an Event parameter into a rule RuleAction.
RuleActionParams are identified by either paramTypeId or paramName (for interface based actions).
The parameter value can either be a static value, a pair of EventTypeId and ParamTypeId or a pair of DeviceId and StateTypeId.
When composing the actual Param for the executeAction() call the value is generated as follows: - Static value params are filled with RuleActionParam::paramTypeId() and the RuleActionParam::value() - Event based actions are filled with RuleActionParam::paramTypeId() and the param value of the event that triggered this rule, identified by RuleActionParam::eventTypeId() and RuleActionParam::eventParamTypeId() - State based actions are filled with RuleActionParam::paramTypeId() and the current value of the state identified by RuleActionParam::deviceId() and RuleActionParam::stateTypeId()
If the param types are not matching, nymea will do a best effort to cast the values. E.g. a RuleActionParam for a param of type "string" and a state of type "int" would cast the integer to a string which would always work. However, the other way round, having a parameter requiring an "int" value, and reading the value from a state of type "string" might work, if the string does only hold numbers but would fail.
See also nymeaserver::Rule and RuleAction.
Constructs a RuleActionParam with the given param.
See also Param.
Constructs a RuleActionParam with the given paramTypeId and value.
Constructs a RuleActionParam with the given paramTypeId, eventTypeId and eventParamTypeId.
Constructs a RuleActionParam with the given paramTypeId, stateDeviceId and stateTypeId.
Constructs a RuleActionParam with the given paramName and value.
Constructs a RuleActionParam with the given paramName, eventTypeId and eventParamTypeId.
Constructs a RuleActionParam with the given paramName, stateDeviceId and stateTypeId.
Returns the eventParamTypeId of this RuleActionParam.
See also setEventParamTypeId().
Return the EventTypeId of the Event with the Param which will be taken over in the RuleAction.
See also setEventTypeId().
Returns true if the (paramTypeId AND value) XOR (paramTypeId AND eventTypeId AND eventParamName)
of this RuleActionParam are set.
Returns the name of this RuleActionParam.
Returns the ParamTypeId of this RuleActionParam.
Sets the eventParamTypeId of this RuleActionParam.
See also eventParamTypeId().
Sets the eventTypeId of the Event with the Param which will be taken over in the RuleAction.
See also eventTypeId().
Sets the deviceId identifying the device to use a state value from.
See also stateDeviceId().
Sets the stateTypeId identifying the state to use the value from.
See also stateTypeId().
Sets the value of this RuleActionParam.
See also value().
Returns the deviceId identifying the device to use a state value from.
See also setStateDeviceId().
Returns the stateTypeId identifying the state to use the value.
See also setStateTypeId().
Returns the value of this RuleActionParam.
See also setValue().