From 66eecd36758f5d36e802edde6101473fd73a9207 Mon Sep 17 00:00:00 2001 From: Adam Jacques Date: Sun, 19 Feb 2023 05:38:27 -0800 Subject: [PATCH] NeoPixel - Add support for ESP32-S3 (#4435) --- esphome/components/neopixelbus/_methods.py | 3 +++ esphome/components/neopixelbus/light.py | 3 ++- script/test | 1 + tests/README.md | 1 + tests/test8.yaml | 27 ++++++++++++++++++++++ 5 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 tests/test8.yaml diff --git a/esphome/components/neopixelbus/_methods.py b/esphome/components/neopixelbus/_methods.py index 98a2d152e..a290257d6 100644 --- a/esphome/components/neopixelbus/_methods.py +++ b/esphome/components/neopixelbus/_methods.py @@ -15,6 +15,7 @@ from esphome.components.esp32.const import ( VARIANT_ESP32, VARIANT_ESP32S2, VARIANT_ESP32C3, + VARIANT_ESP32S3, ) from esphome.core import CORE from .const import ( @@ -58,6 +59,7 @@ SPI_SPEEDS = [40e6, 20e6, 10e6, 5e6, 2e6, 1e6, 500e3] def _esp32_rmt_default_channel(): return { VARIANT_ESP32S2: 1, + VARIANT_ESP32S3: 1, VARIANT_ESP32C3: 1, }.get(get_esp32_variant(), 6) @@ -70,6 +72,7 @@ def _validate_esp32_rmt_channel(value): variant_channels = { VARIANT_ESP32: [0, 1, 2, 3, 4, 5, 6, 7, CHANNEL_DYNAMIC], VARIANT_ESP32S2: [0, 1, 2, 3, CHANNEL_DYNAMIC], + VARIANT_ESP32S3: [0, 1, 2, 3, CHANNEL_DYNAMIC], VARIANT_ESP32C3: [0, 1, CHANNEL_DYNAMIC], } variant = get_esp32_variant() diff --git a/esphome/components/neopixelbus/light.py b/esphome/components/neopixelbus/light.py index 722e6f5b0..072a565ed 100644 --- a/esphome/components/neopixelbus/light.py +++ b/esphome/components/neopixelbus/light.py @@ -220,4 +220,5 @@ async def to_code(config): cg.add(var.set_pixel_order(getattr(ESPNeoPixelOrder, config[CONF_TYPE]))) # https://github.com/Makuna/NeoPixelBus/blob/master/library.json - cg.add_library("makuna/NeoPixelBus", "2.6.9") + # Version Listed Here: https://registry.platformio.org/libraries/makuna/NeoPixelBus/versions + cg.add_library("makuna/NeoPixelBus", "2.7.3") diff --git a/script/test b/script/test index 9f5dca65f..36be9118e 100755 --- a/script/test +++ b/script/test @@ -11,3 +11,4 @@ esphome compile tests/test2.yaml esphome compile tests/test3.yaml esphome compile tests/test4.yaml esphome compile tests/test5.yaml +esphome compile tests/test8.yaml diff --git a/tests/README.md b/tests/README.md index 3238acaa7..6d83fc688 100644 --- a/tests/README.md +++ b/tests/README.md @@ -26,3 +26,4 @@ Current test_.yaml file contents. | test5.yaml | ESP32 | wifi | ble_server | test6.yaml | RP2040 | wifi | N/A | test7.yaml | ESP32-C3 | wifi | N/A +| test8.yaml | ESP32-S3 | wifi | None diff --git a/tests/test8.yaml b/tests/test8.yaml new file mode 100644 index 000000000..c423ecbce --- /dev/null +++ b/tests/test8.yaml @@ -0,0 +1,27 @@ +# Tests for ESP32-S3 boards +--- +wifi: + ssid: "ssid" + +esp32: + board: esp32-c3-devkitm-1 + variant: ESP32S3 + framework: + type: arduino + +esphome: + name: "esp32-s3-test" + +logger: + +light: + - platform: neopixelbus + type: GRB + variant: WS2812 + pin: 33 + num_leds: 1 + id: neopixel + method: esp32_rmt + name: "neopixel-enable" + internal: false + restore_mode: ALWAYS_OFF