54 TEMPLATABLE_VALUE(
bool,
stop)
59 if (this->stop_.has_value())
60 call.
set_stop(this->stop_.value(x...));
61 if (this->position_.has_value())
77 if (this->position_.has_value())
79 if (this->current_operation_.has_value())
ValveCall & set_command_open()
Set the command to open the valve.
ValveOperation
Enum encoding the current operation of a valve.
void play(Ts... x) override
ValveIsOpenCondition(Valve *valve)
bool is_fully_closed() const
Helper method to check if the valve is fully closed. Equivalent to comparing .position against 0...
float position
The position of the valve from 0.0 (fully closed) to 1.0 (fully open).
void add_on_state_callback(std::function< void()> &&f)
CloseAction(Valve *valve)
bool check(Ts... x) override
ValveCall & set_command_stop()
Set the command to stop the valve.
ControlAction(Valve *valve)
ValveCall & set_command_toggle()
Set the command to toggle the valve.
ValveCall make_call()
Construct a new valve call used to control the valve.
ValveCall & set_command_close()
Set the command to close the valve.
void perform()
Perform the valve call.
void play(Ts... x) override
Base class for all automation conditions.
ValveIsClosedCondition(Valve *valve)
bool is_fully_open() const
Helper method to check if the valve is fully open. Equivalent to comparing .position against 1...
ValveCall & set_stop(bool stop)
Set whether this valve call should stop the valve.
ValveClosedTrigger(Valve *a_valve)
ToggleAction(Valve *valve)
void play(Ts... x) override
ValveOpenTrigger(Valve *a_valve)
Implementation of SPI Controller mode.
Base class for all valve devices.
ValveOperation current_operation
The current operation of the valve (idle, opening, closing).
ValvePublishAction(Valve *valve)
void publish_state(bool save=true)
Publish the current state of the valve.
ValveCall & set_position(float position)
Set the call to a certain target position.
bool check(Ts... x) override
void play(Ts... x) override