41 if (
call.get_position().has_value()) {
42 float target = *
call.get_position();
55 if (
call.get_stop()) {
65 traits.set_is_assumed_state(
true);
68 traits.set_supports_position(
true);
71 traits.set_supports_position(
true);
72 traits.set_supports_tilt(
true);
75 traits.set_supports_stop(
true);
76 traits.set_is_assumed_state(
true);
77 traits.set_supports_tilt(
true);
bool cancel_timeout(const std::string &name)
Cancel a timeout function.
void set_timeout(const std::string &name, uint32_t timeout, std::function< void()> &&f)
Set a timeout function with a unique name.
const optional< float > & get_tilt() const
Base class for all cover devices.
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.
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).
cover::CoverTraits get_traits() override
void control(const cover::CoverCall &call) override
void set_type(DemoCoverType type)
@ COVER_OPERATION_OPENING
The cover is currently opening.
@ COVER_OPERATION_CLOSING
The cover is currently closing.
@ COVER_OPERATION_IDLE
The cover is currently idle (not moving)
Providing packet encoding functions for exchanging data with a remote host.