26 void play(
const Ts &...
x)
override {
60 void play(
const Ts &...
x)
override {
66 bool off_speed_cycle = no_off_cycle_.value(
x...);
67 if (
speed > supported_speed_count && off_speed_cycle) {
73 }
else if (
speed > supported_speed_count && !off_speed_cycle) {
130 auto should_trigger = is_on && !this->
last_on_;
132 if (should_trigger) {
149 auto should_trigger = !is_on && this->
last_on_;
150 this->last_on_ = is_on;
151 if (should_trigger) {
170 if (should_trigger) {
189 if (should_trigger) {
208 if (should_trigger) {
227 if (should_trigger) {
virtual void play(const Ts &...x)=0
Base class for all automation conditions.
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.
bool check(const Ts &...x) override
FanIsOffCondition(Fan *state)
bool check(const Ts &...x) override
FanIsOnCondition(Fan *state)
FanOscillatingSetTrigger(Fan *state)
StringRef last_preset_mode_
FanPresetSetTrigger(Fan *state)
FanSpeedSetTrigger(Fan *state)
FanStateTrigger(Fan *state)
int supported_speed_count() const
Return how many speed levels the fan has.
FanTurnOffTrigger(Fan *state)
FanTurnOnTrigger(Fan *state)
void play(const Ts &...x) override
void play(const Ts &...x) override
TurnOffAction(Fan *state)
TurnOnAction(Fan *state, ApplyFn apply)
void(*)(FanCall &, const std::remove_cvref_t< Ts > &...) ApplyFn
void play(const Ts &...x) override
void apply(Climate *climate)
Apply these settings to the climate device.
FanDirection
Simple enum to represent the direction of a fan.