ESPHome 2026.5.0
Loading...
Searching...
No Matches
gpio_binary_output.h
Go to the documentation of this file.
1#pragma once
2
4#include "esphome/core/hal.h"
6
7namespace esphome::gpio {
8
10 public:
11 void set_pin(GPIOPin *pin) { pin_ = pin; }
12
13 void setup() override {
14 this->turn_off();
15 this->pin_->setup();
16 this->turn_off();
17 }
18 void dump_config() override;
19 float get_setup_priority() const override { return setup_priority::HARDWARE; }
20
21 protected:
22 void write_state(bool state) override { this->pin_->digital_write(state); }
23
25};
26
27} // namespace esphome::gpio
virtual void setup()=0
virtual void digital_write(bool value)=0
float get_setup_priority() const override
void write_state(bool state) override
virtual void turn_off()
Disable this binary output.
bool state
Definition fan.h:2
constexpr float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Definition component.h:41