6static const char *
const TAG =
"speed.fan";
13 if (restore.has_value()) {
14 restore->apply(*
this);
22 auto call_state =
call.get_state();
23 if (call_state.has_value())
24 this->
state = *call_state;
25 auto call_speed =
call.get_speed();
26 if (call_speed.has_value())
27 this->
speed = *call_speed;
28 auto call_oscillating =
call.get_oscillating();
29 if (call_oscillating.has_value())
31 auto call_direction =
call.get_direction();
32 if (call_direction.has_value())
void apply_preset_mode_(const FanCall &call)
Apply preset mode from a FanCall (handles speed-clears-preset convention)
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_()
virtual void set_state(bool state)
Enable or disable this binary output.
void set_level(float state)
Set the level of this float output, this is called from the front-end.
void control(const fan::FanCall &call) override
output::BinaryOutput * oscillating_
output::FloatOutput * output_
void dump_config() override
output::BinaryOutput * direction_