From a5a21f47d175c2eeffb0d9eed550c5c749321b5c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 18 Sep 2025 05:22:22 -0500 Subject: [PATCH] [gpio] Fix unused function warnings when compiling with log level below DEBUG (#10779) --- esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp b/esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp index 45544c185b..7a35596194 100644 --- a/esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp +++ b/esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp @@ -6,6 +6,7 @@ namespace gpio { static const char *const TAG = "gpio.binary_sensor"; +#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_DEBUG static const LogString *interrupt_type_to_string(gpio::InterruptType type) { switch (type) { case gpio::INTERRUPT_RISING_EDGE: @@ -22,6 +23,7 @@ static const LogString *interrupt_type_to_string(gpio::InterruptType type) { static const LogString *gpio_mode_to_string(bool use_interrupt) { return use_interrupt ? LOG_STR("interrupt") : LOG_STR("polling"); } +#endif void IRAM_ATTR GPIOBinarySensorStore::gpio_intr(GPIOBinarySensorStore *arg) { bool new_state = arg->isr_pin_.digital_read();