ESPHome 2026.6.0-dev
Loading...
Searching...
No Matches
tuya_switch.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome::tuya {
8
9class TuyaSwitch : public switch_::Switch, public Component {
10 public:
11 void setup() override;
12 void dump_config() override;
13 void set_switch_id(uint8_t switch_id) { this->switch_id_ = switch_id; }
14
15 void set_tuya_parent(Tuya *parent) { this->parent_ = parent; }
16
17 protected:
18 void write_state(bool state) override;
19
21 uint8_t switch_id_{0};
22};
23
24} // namespace esphome::tuya
Base class for all switches.
Definition switch.h:38
bool state
The current reported state of the binary sensor.
Definition switch.h:55
void dump_config() override
void write_state(bool state) override
void set_tuya_parent(Tuya *parent)
Definition tuya_switch.h:15
void set_switch_id(uint8_t switch_id)
Definition tuya_switch.h:13