[neopixelbus] Deprecate on ESP32 (#16676)

This commit is contained in:
Jonathan Swoboda
2026-05-26 19:15:25 -04:00
committed by GitHub
parent f728cb4373
commit e174c44b28

View File

@@ -1,3 +1,5 @@
import logging
from esphome import pins
import esphome.codegen as cg
from esphome.components import light
@@ -22,6 +24,7 @@ from esphome.const import (
Framework,
)
from esphome.core import CORE
from esphome.types import ConfigType
from ._methods import (
METHOD_BIT_BANG,
@@ -34,6 +37,8 @@ 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
@@ -134,6 +139,17 @@ def _validate(config):
return config
def _warn_esp32_deprecated(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."
)
return config
def _validate_method(value):
if value is None:
# default method is determined afterwards because it depends on the chip type chosen
@@ -195,6 +211,7 @@ CONFIG_SCHEMA = cv.All(
).extend(cv.COMPONENT_SCHEMA),
_choose_default_method,
_validate,
_warn_esp32_deprecated,
)