1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-31 23:21:54 +00:00
This commit is contained in:
J. Nick Koston
2025-10-28 22:40:56 -05:00
parent 4cc41606d1
commit cc815fd683

View File

@@ -14,7 +14,7 @@ class TemplateFan : public Component, public fan::Fan {
void set_has_direction(bool has_direction) { this->has_direction_ = has_direction; } void set_has_direction(bool has_direction) { this->has_direction_ = has_direction; }
void set_has_oscillating(bool has_oscillating) { this->has_oscillating_ = has_oscillating; } void set_has_oscillating(bool has_oscillating) { this->has_oscillating_ = has_oscillating; }
void set_speed_count(int count) { this->speed_count_ = count; } void set_speed_count(int count) { this->speed_count_ = count; }
void set_preset_modes(const std::initializer_list<std::string> &presets) { this->preset_modes_ = presets; } void set_preset_modes(std::initializer_list<const char *> presets) { this->preset_modes_ = presets; }
fan::FanTraits get_traits() override { return this->traits_; } fan::FanTraits get_traits() override { return this->traits_; }
protected: protected:
@@ -24,7 +24,7 @@ class TemplateFan : public Component, public fan::Fan {
bool has_direction_{false}; bool has_direction_{false};
int speed_count_{0}; int speed_count_{0};
fan::FanTraits traits_; fan::FanTraits traits_;
std::vector<std::string> preset_modes_{}; FixedVector<const char *> preset_modes_{};
}; };
} // namespace template_ } // namespace template_