54 TEMPLATABLE_VALUE(
bool,
stop)
56 TEMPLATABLE_VALUE(
float,
tilt)
58 void play(Ts...
x)
override {
60 if (this->stop_.has_value())
61 call.
set_stop(this->stop_.value(x...));
62 if (this->position_.has_value())
64 if (this->tilt_.has_value())
65 call.
set_tilt(this->tilt_.value(x...));
77 TEMPLATABLE_VALUE(
float,
tilt)
80 void play(Ts...
x)
override {
81 if (this->position_.has_value())
83 if (this->tilt_.has_value())
85 if (this->current_operation_.has_value())
CoverCall & set_command_open()
Set the command to open the cover.
void publish_state(bool save=true)
Publish the current state of the cover.
Base class for all cover devices.
CoverCall & set_command_stop()
Set the command to stop the cover.
CoverCall make_call()
Construct a new cover call used to control the cover.
CoverOperation
Enum encoding the current operation of a cover.
CoverOperation current_operation
The current operation of the cover (idle, opening, closing).
bool is_fully_open() const
Helper method to check if the cover is fully open. Equivalent to comparing .position against 1...
CoverCall & set_position(float position)
Set the call to a certain target position.
CloseAction(Cover *cover)
void perform()
Perform the cover call.
CoverCall & set_stop(bool stop)
Set whether this cover call should stop the cover.
float tilt
The current tilt value of the cover from 0.0 to 1.0.
CoverClosedTrigger(Cover *a_cover)
CoverOpenTrigger(Cover *a_cover)
void add_on_state_callback(std::function< void()> &&f)
CoverIsClosedCondition(Cover *cover)
Base class for all automation conditions.
CoverCall & set_command_toggle()
Set the command to toggle the cover.
CoverPublishAction(Cover *cover)
CoverCall & set_command_close()
Set the command to close the cover.
ToggleAction(Cover *cover)
bool is_fully_closed() const
Helper method to check if the cover is fully closed. Equivalent to comparing .position against 0...
void play(Ts... x) override
ControlAction(Cover *cover)
float position
The position of the cover from 0.0 (fully closed) to 1.0 (fully open).
void play(Ts... x) override
Implementation of SPI Controller mode.
void play(Ts... x) override
CoverIsOpenCondition(Cover *cover)
bool check(Ts... x) override
CoverCall & set_tilt(float tilt)
Set the call to a certain target tilt.
bool check(Ts... x) override
void play(Ts... x) override