ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
dfrobot_sen0609_switch.h
Go to the documentation of this file.
1#pragma once
2
5
7
8class DFRobotSEN0609Switch final : public switch_::Switch, public Parented<DFRobotSEN0609Component> {
9 public:
10 explicit DFRobotSEN0609Switch(SwitchSetting setting) : setting_(setting) {}
11
12 protected:
13 void write_state(bool state) override { this->parent_->control_switch(this->setting_, state); }
14
16};
17
18} // namespace esphome::dfrobot_sen0609
Helper class to easily give an object a parent of type T.
Definition helpers.h:1997
Base class for all switches.
Definition switch.h:38
bool state
The current reported state of the binary sensor.
Definition switch.h:55
SwitchSetting
Settings shown as switch entities.