From 2ef25f31532bedc302e7cf8aa669b5eeba67c8fe Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Wed, 8 Mar 2023 20:12:07 +1300 Subject: [PATCH] Fix ethernet driver setting gpio 5 high when no power pin defined (#4531) --- esphome/components/ethernet/ethernet_component.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/esphome/components/ethernet/ethernet_component.cpp b/esphome/components/ethernet/ethernet_component.cpp index a3f0ae715f..9152b33a14 100644 --- a/esphome/components/ethernet/ethernet_component.cpp +++ b/esphome/components/ethernet/ethernet_component.cpp @@ -43,8 +43,7 @@ void EthernetComponent::setup() { eth_phy_config_t phy_config = ETH_PHY_DEFAULT_CONFIG(); phy_config.phy_addr = this->phy_addr_; - if (this->power_pin_ != -1) - phy_config.reset_gpio_num = this->power_pin_; + phy_config.reset_gpio_num = this->power_pin_; mac_config.smi_mdc_gpio_num = this->mdc_pin_; mac_config.smi_mdio_gpio_num = this->mdio_pin_;