ESPHome 2025.12.0-dev
Loading...
Searching...
No Matches
template_fan.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace esphome {
7namespace template_ {
8
9class TemplateFan final : public Component, public fan::Fan {
10 public:
12 void setup() override;
13 void dump_config() override;
14 void set_has_direction(bool has_direction) { this->has_direction_ = has_direction; }
15 void set_has_oscillating(bool has_oscillating) { this->has_oscillating_ = has_oscillating; }
16 void set_speed_count(int count) { this->speed_count_ = count; }
17 void set_preset_modes(std::initializer_list<const char *> presets) { this->preset_modes_ = presets; }
18 fan::FanTraits get_traits() override { return this->traits_; }
19
20 protected:
21 void control(const fan::FanCall &call) override;
22
23 bool has_oscillating_{false};
24 bool has_direction_{false};
27 std::vector<const char *> preset_modes_{};
28};
29
30} // namespace template_
31} // namespace esphome
std::vector< const char * > preset_modes_
void control(const fan::FanCall &call) override
void set_has_direction(bool has_direction)
void set_has_oscillating(bool has_oscillating)
fan::FanTraits get_traits() override
void set_preset_modes(std::initializer_list< const char * > presets)
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7