ESPHome  2024.10.2
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 
20  FanTraits get_traits() override { return this->traits_; }
22  void set_traits(const FanTraits &traits) { this->traits_ = traits; }
23 
24  void setup() override;
25  float get_setup_priority() const override;
26 
27  protected:
28  void control(const FanCall &call) override { this->publish_state(); }
29 
30  FanTraits traits_{};
31 };
32 
33 } // namespace fan
34 } // namespace esphome
void setup()
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
enum ESPDEPRECATED("LegacyFanDirection members are deprecated, use FanDirection instead.", "2022.2") LegacyFanDirection
Definition: fan_state.h:9