mirror of
https://github.com/esphome/esphome.git
synced 2026-09-15 17:18:40 +00:00
d178499c28fbb096846132b87a9a15e44584b9d6
Move is_connected() to the header as an inline method that returns a cached bool field. The previous implementation called wifi_sta_connect_status_() on every invocation, which makes SDK calls on ESP8266 (wifi_station_get_connect_status) and RP2040 (cyw43_wifi_link_status + WiFi.status), preventing inlining and adding overhead for the many callers that check it every loop iteration (network::is_connected, API server, MQTT, status sensor, etc.). The cached state is updated once per loop() after wifi_loop_() processes platform events. Internal call sites that need a live SDK query (STA_CONNECTED loss detection, RP2040 can_proceed) use the new is_connected_() private method directly.
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
597 MiB
Languages
C++
55.8%
Python
43.6%
C
0.3%
JavaScript
0.2%
