ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
dfrobot_sen0609_button.h
Go to the documentation of this file.
1#pragma once
2
5
7
8class DFRobotSEN0609Button final : public button::Button, public Parented<DFRobotSEN0609Component> {
9 public:
10 explicit DFRobotSEN0609Button(ButtonAction action) : action_(action) {}
11
12 protected:
13 void press_action() override {
14 switch (this->action_) {
15 case BUTTON_RESTART:
16 this->parent_->restart();
17 break;
19 this->parent_->factory_reset();
20 break;
22 this->parent_->query_params();
23 break;
24 }
25 }
26
28};
29
30} // namespace esphome::dfrobot_sen0609
Helper class to easily give an object a parent of type T.
Definition helpers.h:1997
Base class for all buttons.
Definition button.h:25