ESPHome  2024.10.2
template_fan.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <set>
4 
7 
8 namespace esphome {
9 namespace template_ {
10 
11 class TemplateFan : public Component, public fan::Fan {
12  public:
14  void setup() override;
15  void dump_config() override;
16  void set_has_direction(bool has_direction) { this->has_direction_ = has_direction; }
17  void set_has_oscillating(bool has_oscillating) { this->has_oscillating_ = has_oscillating; }
18  void set_speed_count(int count) { this->speed_count_ = count; }
19  void set_preset_modes(const std::set<std::string> &presets) { this->preset_modes_ = presets; }
20  fan::FanTraits get_traits() override { return this->traits_; }
21 
22  protected:
23  void control(const fan::FanCall &call) override;
24 
25  bool has_oscillating_{false};
26  bool has_direction_{false};
27  int speed_count_{0};
29  std::set<std::string> preset_modes_{};
30 };
31 
32 } // namespace template_
33 } // namespace esphome
std::set< std::string > preset_modes_
Definition: template_fan.h:29
void set_has_direction(bool has_direction)
Definition: template_fan.h:16
fan::FanTraits get_traits() override
Definition: template_fan.h:20
void set_has_oscillating(bool has_oscillating)
Definition: template_fan.h:17
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void control(const fan::FanCall &call) override
void set_preset_modes(const std::set< std::string > &presets)
Definition: template_fan.h:19