ESPHome 2025.5.0
Loading...
Searching...
No Matches
tuya_fan.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome {
8namespace tuya {
9
10class TuyaFan : public Component, public fan::Fan {
11 public:
12 TuyaFan(Tuya *parent, int speed_count) : parent_(parent), speed_count_(speed_count) {}
13 void setup() override;
14 void dump_config() override;
15 void set_speed_id(uint8_t speed_id) { this->speed_id_ = speed_id; }
16 void set_switch_id(uint8_t switch_id) { this->switch_id_ = switch_id; }
17 void set_oscillation_id(uint8_t oscillation_id) { this->oscillation_id_ = oscillation_id; }
18 void set_direction_id(uint8_t direction_id) { this->direction_id_ = direction_id; }
19
20 fan::FanTraits get_traits() override;
21
22 protected:
23 void control(const fan::FanCall &call) override;
24
33};
34
35} // namespace tuya
36} // namespace esphome
optional< uint8_t > speed_id_
Definition tuya_fan.h:26
void dump_config() override
Definition tuya_fan.cpp:61
TuyaDatapointType speed_type_
Definition tuya_fan.h:31
fan::FanTraits get_traits() override
Definition tuya_fan.cpp:77
void setup() override
Definition tuya_fan.cpp:9
void set_speed_id(uint8_t speed_id)
Definition tuya_fan.h:15
void set_oscillation_id(uint8_t oscillation_id)
Definition tuya_fan.h:17
optional< uint8_t > oscillation_id_
Definition tuya_fan.h:28
optional< uint8_t > switch_id_
Definition tuya_fan.h:27
TuyaFan(Tuya *parent, int speed_count)
Definition tuya_fan.h:12
optional< uint8_t > direction_id_
Definition tuya_fan.h:29
TuyaDatapointType oscillation_type_
Definition tuya_fan.h:32
void control(const fan::FanCall &call) override
Definition tuya_fan.cpp:82
void set_direction_id(uint8_t direction_id)
Definition tuya_fan.h:18
void set_switch_id(uint8_t switch_id)
Definition tuya_fan.h:16
TuyaDatapointType
Definition tuya.h:19
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7