15 void play(
const Ts &...
x)
override {
21 bool off_speed_cycle = no_off_cycle_.value(
x...);
22 if (
speed > supported_speed_count && off_speed_cycle) {
28 }
else if (
speed > supported_speed_count && !off_speed_cycle) {
58 auto should_trigger = is_on && !this->
last_on_;
77 auto should_trigger = !is_on && this->
last_on_;
78 this->last_on_ = is_on;
117 if (should_trigger) {
136 if (should_trigger) {
155 if (should_trigger) {
virtual void play(const Ts &...x)=0
StringRef is a reference to a string owned by something else.
void trigger(const Ts &...x) ESPHOME_ALWAYS_INLINE
TEMPLATABLE_VALUE(bool, no_off_cycle) void play(const Ts &...x) override
CycleSpeedAction(Fan *state)
FanCall & set_speed(int speed)
FanDirectionSetTrigger(Fan *state)
FanDirection last_direction_
void add_on_state_callback(F &&callback)
Register a callback that will be called each time the state changes.
virtual FanTraits get_traits()=0
StringRef get_preset_mode() const
Get the current preset mode.
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.
FanOscillatingSetTrigger(Fan *state)
StringRef last_preset_mode_
FanPresetSetTrigger(Fan *state)
FanSpeedSetTrigger(Fan *state)
int supported_speed_count() const
Return how many speed levels the fan has.
FanTurnOffTrigger(Fan *state)
FanTurnOnTrigger(Fan *state)
FanDirection
Simple enum to represent the direction of a fan.