This commit is contained in:
Edward Firmo 2024-12-18 19:19:18 +01:00
parent 69efd42570
commit fff6c314bb
6 changed files with 30 additions and 78 deletions

View File

@ -126,6 +126,7 @@ NeoEsp32RmtMethodBase = neo_ns.class_("NeoEsp32RmtMethodBase")
NeoEsp32RmtSpeedBase = neo_ns.class_("NeoEsp32RmtSpeedBase")
NeoEsp32RmtSpeed = neo_ns.class_("NeoEsp32RmtSpeed")
def _bit_bang_to_code(config, chip: str, inverted: bool):
# https://github.com/Makuna/NeoPixelBus/blob/master/src/internal/NeoEspBitBangMethod.h
# Some chips are only aliases
@ -306,7 +307,9 @@ def _esp32_rmt_to_code(config, chip: str, inverted: bool):
}
if (chip, inverted) not in lookup:
raise cv.Invalid(f"Unsupported chip {chip} with inverted={inverted} for RMT method.")
raise cv.Invalid(
f"Unsupported chip {chip} with inverted={inverted} for RMT method."
)
speed = lookup[(chip, inverted)]
return neo_ns.NeoEsp32RmtMethodBase.template(speed, channel)
@ -357,7 +360,9 @@ def _esp32_i2s_to_code(config, chip: str, inverted: bool):
False: neo_ns.NeoEsp32I2sNotInverted,
True: neo_ns.NeoEsp32I2sInverted,
}[inverted != inv_inverted]
return neo_ns.NeoEsp32I2sMethodBase.template(speed, bus, inv, neo_ns.NeoEsp32I2sCadence)
return neo_ns.NeoEsp32I2sMethodBase.template(
speed, bus, inv, neo_ns.NeoEsp32I2sCadence
)
def _spi_to_code(config, chip: str, inverted: bool):

View File

@ -0,0 +1,17 @@
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

View File

@ -1,17 +1 @@
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
<<: !include common_i2s.yaml

View File

@ -1,19 +1 @@
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:
type: esp32_rmt
channel: 0
num_leds: 5
pin: 4
<<: !include common_i2s.yaml

View File

@ -1,19 +1 @@
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:
type: esp32_rmt
channel: 0
num_leds: 5
pin: 4
<<: !include common_i2s.yaml

View File

@ -1,19 +1 @@
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:
type: esp32_rmt
channel: 0
num_leds: 5
pin: 4
<<: !include common_i2s.yaml