ESPHome 2025.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 {
8namespace gpio {
9
11 public:
12 void set_pin(GPIOPin *pin) { pin_ = pin; }
13
14 void setup() override {
15 this->turn_off();
16 this->pin_->setup();
17 this->turn_off();
18 }
19 void dump_config() override;
20 float get_setup_priority() const override { return setup_priority::HARDWARE; }
21
22 protected:
23 void write_state(bool state) override { this->pin_->digital_write(state); }
24
26};
27
28} // namespace gpio
29} // namespace esphome
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:0
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Definition component.cpp:18
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7