void control(const valve::ValveCall &call) override
valve::ValveTraits get_traits() override
void set_type(DemoValveType type)
value_type const & value() const
const optional< bool > & get_toggle() const
const optional< float > & get_position() const
Base class for all valve devices.
void publish_state(bool save=true)
Publish the current state of the valve.
float position
The position of the valve from 0.0 (fully closed) to 1.0 (fully open).
ValveOperation current_operation
The current operation of the valve (idle, opening, closing).
void set_supports_position(bool supports_position)
void set_supports_stop(bool supports_stop)
void set_supports_toggle(bool supports_toggle)
@ VALVE_OPERATION_IDLE
The valve is currently idle (not moving)
Providing packet encoding functions for exchanging data with a remote host.