ESPHome  2022.11.4
fan_state.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "fan.h"
5 
6 namespace esphome {
7 namespace fan {
8 
9 enum ESPDEPRECATED("LegacyFanDirection members are deprecated, use FanDirection instead.",
10  "2022.2") LegacyFanDirection {
13 };
14 
15 class ESPDEPRECATED("FanState is deprecated, use Fan instead.", "2022.2") FanState : public Fan, public Component {
16  public:
17  FanState() = default;
18  explicit FanState(const std::string &name) : Fan(name) {}
19 
21  FanTraits get_traits() override { return this->traits_; }
23  void set_traits(const FanTraits &traits) { this->traits_ = traits; }
24 
25  void setup() override;
26  float get_setup_priority() const override;
27 
28  protected:
29  void control(const FanCall &call) override { this->publish_state(); }
30 
31  FanTraits traits_{};
32 };
33 
34 } // namespace fan
35 } // namespace esphome
void setup()
const char * name
Definition: stm32flash.h:78
Definition: a4988.cpp:4
enum ESPDEPRECATED("LegacyFanDirection members are deprecated, use FanDirection instead.", "2022.2") LegacyFanDirection
Definition: fan_state.h:9