Update syntax for esp-idf.

Apparently esp-idf will be required by ESPHome 2026.1.0, so just making
the switch to esp-idf now.

The syntax change appears to still work with Arduino as well.
This commit is contained in:
Victor Chang
2025-08-29 15:44:00 -07:00
parent 80b501fe46
commit 475044ffbf
2 changed files with 7 additions and 2 deletions

View File

@@ -7,8 +7,8 @@ namespace emporia_vue_utility {
void EmporiaVueUtility::setup() {
#if USE_LED_PINS
pinMode(LED_PIN_LINK, OUTPUT);
pinMode(LED_PIN_WIFI, OUTPUT);
set_pin_to_output(LED_PIN_LINK);
set_pin_to_output(LED_PIN_WIFI);
#endif
led_link(false);
led_wifi(false);

View File

@@ -794,5 +794,10 @@ class EmporiaVueUtility : public PollingComponent, public uart::UARTDevice {
bool ready_to_read_meter_ = false;
};
static inline void set_pin_to_output(gpio_num_t pin) {
gpio_reset_pin(pin);
gpio_set_direction(pin, GPIO_MODE_OUTPUT);
}
} // namespace emporia_vue_utility
} // namespace esphome