7static const char *
const TAG =
"gpio.binary_sensor";
37 ESP_LOGD(TAG,
"GPIO is not internal, falling back to polling mode");
52 LOG_BINARY_SENSOR(
"",
"GPIO Binary Sensor",
this);
53 LOG_PIN(
" Pin: ", this->
pin_);
55 ESP_LOGCONFIG(TAG,
" Mode: %s",
mode);
57 const char *interrupt_type;
60 interrupt_type =
"RISING_EDGE";
63 interrupt_type =
"FALLING_EDGE";
66 interrupt_type =
"ANY_EDGE";
69 interrupt_type =
"UNKNOWN";
72 ESP_LOGCONFIG(TAG,
" Interrupt Type: %s", interrupt_type);
BedjetMode mode
BedJet operating mode.
void enable_loop_soon_any_context()
Thread and ISR-safe version of enable_loop() that can be called from any context.
void disable_loop()
Disable this component's loop.
virtual bool is_internal()
virtual bool digital_read()=0
void attach_interrupt(void(*func)(T *), T *arg, gpio::InterruptType type) const
virtual ISRInternalGPIOPin to_isr() const =0
void publish_state(bool new_state)
Publish a new state to the front-end.
void publish_initial_state(bool new_state)
Publish the initial state, this will not make the callback manager send callbacks and is meant only f...
void dump_config() override
void loop() override
Check sensor.
gpio::InterruptType interrupt_type_
float get_setup_priority() const override
Hardware priority.
GPIOBinarySensorStore store_
void setup() override
Setup pin.
ISRInternalGPIOPin isr_pin_
void setup(InternalGPIOPin *pin, gpio::InterruptType type, Component *component)
volatile bool last_state_
static void gpio_intr(GPIOBinarySensorStore *arg)
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Providing packet encoding functions for exchanging data with a remote host.