mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-02 02:58:26 +02:00
Add WLED support (#1092)
A component to support [WLED](https://github.com/Aircoookie/WLED/wiki/UDP-Realtime-Control). This allows to control addressable LEDs over WiFi/UDP, by pushing data right into LEDs. The most useful to use [Prismatik](https://github.com/psieg/Lightpack) to create an immersive effect on PC. It supports all WLED protocols: - WARLS - DRGB - DRGBW - DNRGB - WLED Notifier Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import esphome.codegen as cg
|
||||
import esphome.config_validation as cv
|
||||
from esphome.components.light.types import AddressableLightEffect
|
||||
from esphome.components.light.effects import register_addressable_effect
|
||||
from esphome.const import CONF_NAME, CONF_PORT
|
||||
|
||||
wled_ns = cg.esphome_ns.namespace('wled')
|
||||
WLEDLightEffect = wled_ns.class_('WLEDLightEffect', AddressableLightEffect)
|
||||
|
||||
CONFIG_SCHEMA = cv.Schema({})
|
||||
|
||||
|
||||
@register_addressable_effect('wled', WLEDLightEffect, "WLED", {
|
||||
cv.Optional(CONF_PORT, default=21324): cv.port,
|
||||
})
|
||||
def wled_light_effect_to_code(config, effect_id):
|
||||
effect = cg.new_Pvariable(effect_id, config[CONF_NAME])
|
||||
cg.add(effect.set_port(config[CONF_PORT]))
|
||||
|
||||
yield effect
|
||||
Reference in New Issue
Block a user