diff --git a/esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp b/esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp index 8832ed02c3..4b8369cd59 100644 --- a/esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp +++ b/esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp @@ -14,7 +14,7 @@ void IRAM_ATTR GPIOBinarySensorStore::gpio_intr(GPIOBinarySensorStore *arg) { arg->changed_ = true; // Wake up the component from its disabled loop state if (arg->component_ != nullptr) { - arg->component_->enable_loop_soon_from_isr(); + arg->component_->enable_loop_soon_any_context(); } } } diff --git a/esphome/components/gpio/binary_sensor/gpio_binary_sensor.h b/esphome/components/gpio/binary_sensor/gpio_binary_sensor.h index e2802252d5..8cf52f540b 100644 --- a/esphome/components/gpio/binary_sensor/gpio_binary_sensor.h +++ b/esphome/components/gpio/binary_sensor/gpio_binary_sensor.h @@ -36,7 +36,7 @@ class GPIOBinarySensorStore { volatile bool state_{false}; volatile bool last_state_{false}; volatile bool changed_{false}; - Component *component_{nullptr}; // Pointer to the component for enable_loop_soon_from_isr() + Component *component_{nullptr}; // Pointer to the component for enable_loop_soon_any_context() }; class GPIOBinarySensor : public binary_sensor::BinarySensor, public Component {