22 #ifndef INCLUDE_HUEPLUSPLUS_CONDITION_H 23 #define INCLUDE_HUEPLUSPLUS_CONDITION_H 27 #include "json/json.hpp" 70 nlohmann::json
toJson()
const;
94 class GeneralConditionHelper
97 explicit GeneralConditionHelper(
const std::string& address) : address(address) { }
111 class ConditionHelper<int> :
public GeneralConditionHelper
114 using GeneralConditionHelper::GeneralConditionHelper;
125 class ConditionHelper<bool> :
public GeneralConditionHelper
128 using GeneralConditionHelper::GeneralConditionHelper;
137 class ConditionHelper<time::AbsoluteTime> :
public GeneralConditionHelper
140 using GeneralConditionHelper::GeneralConditionHelper;
155 template <
typename... Ts>
161 template <
typename... Ts>
162 using void_t =
typename make_void<Ts...>::type;
Condition for a Rule.
Definition: Condition.h:37
Time is in the given interval (triggered on start time, local time)
Stable for a given time. Does not trigger a rule change.
std::string getValue() const
Get value the attribute is checked against.
Definition: Rule.cpp:38
std::string toString() const
Get formatted string as expected by Hue API.
Definition: TimePattern.cpp:159
Operator
Specifies which operation is used to check the condition.
Definition: Condition.h:41
Condition(const std::string &address, Operator op, const std::string &value)
Create a condition from any address on the bridge.
Definition: Rule.cpp:27
Time interval repeated daily to weekly.
Definition: TimePattern.h:260
Delayed attribute has changed (no value given)
Namespace for the hueplusplus library.
Definition: Action.h:27
std::string getAddress() const
Get address on the bridge.
Definition: Rule.cpp:30
std::string toString() const
Get formatted string as expected by Hue API.
Definition: TimePattern.cpp:379
Operator getOperator() const
Get used operator.
Definition: Rule.cpp:34
One-time, absolute time point.
Definition: TimePattern.h:72
static Condition parse(const nlohmann::json &json)
Parse condition from json value.
Definition: Rule.cpp:87
Attribute is less than specified value (for int)
Not stable for a given time. Does not trigger a rule change.
Attribute is greater than specified value (for int)
Attribute is equal to specified value (for bool and int)
Time is not in the interval (triggered on end time, local time)
nlohmann::json toJson() const
Create the json form of the condition.
Definition: Rule.cpp:43
Attribute has changed (no value given)