ESPHome 2025.5.0
Loading...
Searching...
No Matches
tuya_switch.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome {
8namespace tuya {
9
10class TuyaSwitch : public switch_::Switch, public Component {
11 public:
12 void setup() override;
13 void dump_config() override;
14 void set_switch_id(uint8_t switch_id) { this->switch_id_ = switch_id; }
15
16 void set_tuya_parent(Tuya *parent) { this->parent_ = parent; }
17
18 protected:
19 void write_state(bool state) override;
20
22 uint8_t switch_id_{0};
23};
24
25} // namespace tuya
26} // namespace esphome
Base class for all switches.
Definition switch.h:39
bool state
The current reported state of the binary sensor.
Definition switch.h:53
void dump_config() override
void write_state(bool state) override
void set_tuya_parent(Tuya *parent)
Definition tuya_switch.h:16
void set_switch_id(uint8_t switch_id)
Definition tuya_switch.h:14
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7