1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-17 15:26:01 +00:00

Fix ethernet component hostname handling (#2010)

Co-authored-by: Otto Winter <otto@otto-winter.com>
This commit is contained in:
Sean Vig
2021-07-14 23:45:41 -04:00
committed by GitHub
parent 0651716b96
commit 628a94bad3
3 changed files with 120 additions and 106 deletions

View File

@@ -26,6 +26,12 @@ struct ManualIP {
IPAddress dns2; ///< The second DNS server. 0.0.0.0 for default.
};
enum class EthernetComponentState {
STOPPED,
CONNECTING,
CONNECTED,
};
class EthernetComponent : public Component {
public:
EthernetComponent();
@@ -65,9 +71,9 @@ class EthernetComponent : public Component {
eth_clock_mode_t clk_mode_{ETH_CLOCK_GPIO0_IN};
optional<ManualIP> manual_ip_{};
bool initialized_{false};
bool started_{false};
bool connected_{false};
bool last_connected_{false};
EthernetComponentState state_{EthernetComponentState::STOPPED};
uint32_t connect_begin_;
eth_config_t eth_config;
eth_phy_power_enable_func orig_power_enable_fun_;