58 void play(Ts...
x)
override {
60 if (this->stop_.has_value())
62 if (this->position_.has_value())
64 if (this->tilt_.has_value())
80 void play(Ts...
x)
override {
81 if (this->position_.has_value())
82 this->cover_->position = this->position_.value(
x...);
83 if (this->tilt_.has_value())
84 this->cover_->tilt = this->tilt_.value(
x...);
85 if (this->current_operation_.has_value())
86 this->cover_->current_operation = this->current_operation_.value(
x...);
87 this->cover_->publish_state();
virtual void play(Ts... x)=0
Base class for all automation conditions.
void play(Ts... x) override
CloseAction(Cover *cover)
ControlAction(Cover *cover)
TEMPLATABLE_VALUE(bool, stop) TEMPLATABLE_VALUE(float
CoverCall & set_command_toggle()
Set the command to toggle the cover.
CoverCall & set_command_open()
Set the command to open the cover.
CoverCall & set_command_close()
Set the command to close the cover.
void perform()
Perform the cover call.
CoverCall & set_position(float position)
Set the call to a certain target position.
CoverCall & set_command_stop()
Set the command to stop the cover.
CoverCall & set_tilt(float tilt)
Set the call to a certain target tilt.
CoverCall & set_stop(bool stop)
Set whether this cover call should stop the cover.
CoverClosedTrigger(Cover *a_cover)
Base class for all cover devices.
void add_on_state_callback(std::function< void()> &&f)
CoverCall make_call()
Construct a new cover call used to control the cover.
bool is_fully_closed() const
Helper method to check if the cover is fully closed. Equivalent to comparing .position against 0....
bool is_fully_open() const
Helper method to check if the cover is fully open. Equivalent to comparing .position against 1....
bool check(Ts... x) override
CoverIsClosedCondition(Cover *cover)
bool check(Ts... x) override
CoverIsOpenCondition(Cover *cover)
CoverOpenTrigger(Cover *a_cover)
TEMPLATABLE_VALUE(float, position) TEMPLATABLE_VALUE(float
CoverPublishAction(Cover *cover)
void play(Ts... x) override
void play(Ts... x) override
void play(Ts... x) override
ToggleAction(Cover *cover)
CoverOperation
Enum encoding the current operation of a cover.
Providing packet encoding functions for exchanging data with a remote host.