情人節(jié),宇宙為她而閃爍!

固件配置代碼,需要的自取??
esphome:
?name: led-rgb
esp8266:
?board: esp01_1m
?framework:
??version: 2.7.4
# Enable logging
logger:
# Enable Home Assistant API
api:
?encryption:
??key: "填入你自己的內容"
ota:
?password: "填入你自己的內容"
wifi:
?ssid: !secret wifi_ssid
?password: !secret wifi_password
?manual_ip: #這里最好固定一個IP地址
??static_ip: 192.168.31.64 ##IP 自己設定,和你路由器分配的地址是同一個網段。
??gateway: 192.168.31.1 #網關
??subnet: 255.255.255.0 #子網掩碼
?# Enable fallback hotspot (captive portal) in case wifi connection fails
?ap:
??ssid: "Led-Rgb Fallback Hotspot"
??password: "PFNQm0XIhWkP"
captive_portal:
light:
?- platform: fastled_clockless ##不能更改
??on_turn_on:
??- light.turn_on:?
????id: RGB_WS2812
????effect: "Fast Pulse"
??chipset: WS2811 ##不能更改
??pin: GPIO2 ##我用的是GPIO-2
??num_leds: 30 ##WS2812B 燈珠數(shù)目,根據(jù)實際情況填寫
??rgb_order: GRB #如果你已經有了不同型號的RGB LED 這里可能的順序不一樣,需要更改。如果不更改的話,可能顏色不準。具體更改哪個順序,到ESPHome官網查詢。
??name: 燈帶 ##名稱自定義
??id: RGB_WS2812
??effects:
???# Use default parameters:
???- random:
???# Customize parameters
???- random:
?????name: "My Slow Random Effect"
?????transition_length: 30s
?????update_interval: 30s
???- random:
?????name: "My Fast Random Effect"
?????transition_length: 4s
?????update_interval: 5s
???- pulse:
???- pulse:
?????name: "Fast Pulse"
?????transition_length: 0.5s
?????update_interval: 0.5s
???- pulse:
?????name: "Slow Pulse"
?????# transition_length: 1s???# defaults to 1s
?????update_interval: 2s
???- random:
?????name: Random Effect With Custom Values
?????transition_length: 5s
?????update_interval: 7s
???- strobe:
???- strobe:
?????name: Strobe Effect With Custom Values
?????colors:
??????- state: true
???????brightness: 100%
???????red: 100%
???????green: 90%
???????blue: 0%
???????duration: 500ms
??????- state: false
?????