ESPHome 2025.5.0
Loading...
Searching...
No Matches
template_fan.h
Go to the documentation of this file.
1#pragma once
2
3#include <set>
4
7
8namespace esphome {
9namespace template_ {
10
11class 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};
29 std::set<std::string> preset_modes_{};
30};
31
32} // namespace template_
33} // namespace esphome
std::set< std::string > preset_modes_
void control(const fan::FanCall &call) override
void set_has_direction(bool has_direction)
void set_preset_modes(const std::set< std::string > &presets)
void set_has_oscillating(bool has_oscillating)
fan::FanTraits get_traits() override
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7