7static const char *
const TAG =
"template.fan";
11 if (restore.has_value()) {
12 restore->apply(*
this);
24 if (
call.get_state().has_value())
26 if (
call.get_speed().has_value() && (this->speed_count_ > 0))
28 if (
call.get_oscillating().has_value() && this->has_oscillating_)
30 if (
call.get_direction().has_value() && this->has_direction_)
optional< bool > get_state() const
const char * get_preset_mode() const
optional< bool > get_oscillating() const
optional< int > get_speed() const
optional< FanDirection > get_direction() const
bool set_preset_mode_(const char *preset_mode)
Set the preset mode (finds and stores pointer from traits). Returns true if changed.
FanDirection direction
The current direction of the fan.
bool oscillating
The current oscillation state of the fan.
bool state
The current on/off state of the fan.
int speed
The current fan speed level.
optional< FanRestoreState > restore_state_()
void set_supported_preset_modes(std::initializer_list< const char * > preset_modes)
Set the preset modes supported by the fan (from initializer list).
std::vector< const char * > preset_modes_
void control(const fan::FanCall &call) override
void dump_config() override
Providing packet encoding functions for exchanging data with a remote host.