Compare commits

..
Author SHA1 Message Date
Jonathan Swoboda 5c9033e04d [neopixelbus] Remove ESP32 support (#22796) 2026-11-16 13:11:50 -05:00
5 changed files with 12 additions and 71 deletions

No files matched your search

@@ -358,8 +358,6 @@ class EthernetComponent final : public Component {
// to be called at runtime after enable_on_boot:false without re-allocating, and
// ensures setup() skips the heavy init when enable_on_boot_ is false.
bool ethernet_initialized_{false};
// PHY link state from ETHERNET_EVENT_CONNECTED/DISCONNECTED; the connect timeout retries only with a link.
bool link_up_{false};
#endif
#if LWIP_IPV6
uint8_t ipv6_count_{0};
@@ -160,15 +160,8 @@ void EthernetComponent::loop() {
this->connect_trigger_.trigger();
#endif
} else if (now - this->connect_begin_ > 15000) {
if (this->link_up_) {
ESP_LOGW(TAG, "Connecting failed; reconnecting");
this->start_connect_();
} else {
// Restarting DHCP without a link only empties lwIP's DNS servers (espressif/esp-idf#19082);
// the DHCP client already running resumes when the link comes up.
ESP_LOGW(TAG, "Connecting failed: no link");
this->connect_begin_ = now;
}
ESP_LOGW(TAG, "Connecting failed; reconnecting");
this->start_connect_();
}
break;
case EthernetComponentState::CONNECTED:
@@ -772,12 +765,10 @@ void EthernetComponent::eth_event_handler(void *arg, esp_event_base_t event_base
event_name = "ETH stopped";
global_eth_component->started_ = false;
global_eth_component->connected_ = false;
global_eth_component->link_up_ = false;
global_eth_component->enable_loop_soon_any_context(); // Enable loop when connection state changes
break;
case ETHERNET_EVENT_CONNECTED:
event_name = "ETH connected";
global_eth_component->link_up_ = true;
// For static IP configurations, GOT_IP event may not fire, so notify IP listeners here
#if defined(USE_ETHERNET_IP_STATE_LISTENERS) && defined(USE_ETHERNET_MANUAL_IP)
global_eth_component->ip_state_pending_.store(1, std::memory_order_release);
@@ -794,7 +785,6 @@ void EthernetComponent::eth_event_handler(void *arg, esp_event_base_t event_base
case ETHERNET_EVENT_DISCONNECTED:
event_name = "ETH disconnected";
global_eth_component->connected_ = false;
global_eth_component->link_up_ = false;
global_eth_component->enable_loop_soon_any_context(); // Enable loop when connection state changes
break;
default:
+7 -21
View File
@@ -1,5 +1,3 @@
import logging
from esphome import pins
import esphome.codegen as cg
from esphome.components import light
@@ -37,8 +35,6 @@ from ._methods import (
)
from .const import CHIP_TYPES, CONF_ASYNC, CONF_BUS, ONE_WIRE_CHIPS
_LOGGER = logging.getLogger(__name__)
neopixelbus_ns = cg.esphome_ns.namespace("neopixelbus")
NeoPixelBusLightOutputBase = neopixelbus_ns.class_(
"NeoPixelBusLightOutputBase", light.AddressableLight
@@ -139,13 +135,12 @@ def _validate(config):
return config
def _warn_esp32_deprecated(config: ConfigType) -> ConfigType:
def _reject_esp32(config: ConfigType) -> ConfigType:
if CORE.is_esp32:
_LOGGER.warning(
"'neopixelbus' on ESP32 is deprecated. The upstream library "
"(makuna/NeoPixelBus) is no longer actively maintained. Migrate "
"to 'esp32_rmt_led_strip'. Removal is targeted for 2027.1 but "
"may happen sooner once ESPHome moves to ESP-IDF 6."
raise cv.Invalid(
"'neopixelbus' is no longer supported on ESP32. Use the "
"'esp32_rmt_led_strip' light platform instead: "
"https://esphome.io/components/light/esp32_rmt_led_strip/"
)
return config
@@ -183,18 +178,10 @@ def _validate_method(value):
CONFIG_SCHEMA = cv.All(
cv.only_with_framework(
frameworks=Framework.ARDUINO,
suggestions={
Framework.ESP_IDF: (
"esp32_rmt_led_strip",
"light/esp32_rmt_led_strip",
)
},
),
_reject_esp32,
cv.only_with_framework(frameworks=Framework.ARDUINO),
cv.require_framework_version(
esp8266_arduino=cv.Version(2, 4, 0),
esp32_arduino=cv.Version(0, 0, 0),
),
light.ADDRESSABLE_LIGHT_SCHEMA.extend(
{
@@ -211,7 +198,6 @@ CONFIG_SCHEMA = cv.All(
).extend(cv.COMPONENT_SCHEMA),
_choose_default_method,
_validate,
_warn_esp32_deprecated,
)
@@ -12,9 +12,7 @@
#include "esphome/core/application.h"
#include "esphome/core/helpers.h"
#include "esp_netif_net_stack.h"
#include "lwip/dns.h"
#include "lwip/netif.h"
#include "ip_address.h"
#ifdef USE_ETHERNET
#include "esphome/components/ethernet/ethernet_component.h"
#endif
@@ -74,18 +72,6 @@ static esp_netif_t *connected_ethernet_netif() {
return nullptr;
}
// True when lwIP's global DNS table holds the netif's own servers. Call with the lwIP core lock held.
static bool dns_is_netifs(esp_netif_t *netif) {
for (auto type : {ESP_NETIF_DNS_MAIN, ESP_NETIF_DNS_BACKUP}) {
esp_netif_dns_info_t own{};
if (esp_netif_get_dns_info(netif, type, &own) != ESP_OK)
return true;
if (IPAddress(&own.ip) != IPAddress(dns_getserver(type)))
return false;
}
return true;
}
void NetworkComponent::loop() {
// Pin the default route to the first connected interface in the user's priority
// order; ESP-IDF's own route_prio selection would always favor WiFi.
@@ -128,14 +114,12 @@ void NetworkComponent::loop() {
if (now - this->last_route_check_ < ROUTE_CHECK_INTERVAL_MS)
return;
this->last_route_check_ = now;
bool still_ours;
bool route_is_ours;
{
LwIPLock lock;
// DHCP starting on another netif empties lwIP's DNS table, and the manual default
// stops ESP-IDF from refilling it (espressif/esp-idf#19082); re-asserting copies it back.
still_ours = static_cast<void *>(netif_default) == esp_netif_get_netif_impl(best) && dns_is_netifs(best);
route_is_ours = static_cast<void *>(netif_default) == esp_netif_get_netif_impl(best);
}
if (still_ours)
if (route_is_ours)
return;
}
esp_err_t err = esp_netif_set_default_netif(best);
@@ -1,17 +0,0 @@
light:
- platform: neopixelbus
id: addr3
name: Neopixelbus Light
gamma_correct: 2.8
color_correct: [0.0, 0.0, 0.0, 0.0]
default_transition_length: 10s
effects:
- addressable_flicker:
name: Flicker Effect With Custom Values
update_interval: 16ms
intensity: 5%
type: GRBW
variant: SK6812
method: ESP32_I2S_0
num_leds: 5
pin: 4