7static const char *
const TAG =
"copy.cover";
31 traits.set_supports_stop(base.get_supports_stop());
32 traits.set_supports_position(base.get_supports_position());
33 traits.set_supports_tilt(base.get_supports_tilt());
34 traits.set_supports_toggle(base.get_supports_toggle());
41 if (
call.get_tilt().has_value())
43 if (
call.get_position().has_value())
45 if (
call.get_tilt().has_value())
cover::CoverTraits get_traits() override
void control(const cover::CoverCall &call) override
void dump_config() override
void perform()
Perform the cover call.
CoverCall & set_position(float position)
Set the call to a certain target position.
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.
CoverOperation current_operation
The current operation of the cover (idle, opening, closing).
void publish_state(bool save=true)
Publish the current state of the cover.
void add_on_state_callback(std::function< void()> &&f)
CoverCall make_call()
Construct a new cover call used to control the cover.
float tilt
The current tilt value of the cover from 0.0 to 1.0.
float position
The position of the cover from 0.0 (fully closed) to 1.0 (fully open).
virtual CoverTraits get_traits()=0
void set_is_assumed_state(bool is_assumed_state)
Providing packet encoding functions for exchanging data with a remote host.