101 lines
2.3 KiB
YAML
101 lines
2.3 KiB
YAML
esphome:
|
|
name: bindicator
|
|
|
|
esp32:
|
|
board: esp32-c3-devkitm-1
|
|
framework:
|
|
type: arduino
|
|
|
|
logger:
|
|
level: INfO
|
|
baud_rate: 0
|
|
|
|
ota:
|
|
password: "bd2c004f2016fde90fbbb01706ad039a"
|
|
|
|
wifi:
|
|
ssid: !secret ssid
|
|
password: !secret pass
|
|
|
|
mqtt:
|
|
broker: mqtt.srv.jnf.me
|
|
username: esphome
|
|
password: esphome
|
|
topic_prefix: esphome/bindicator
|
|
|
|
light:
|
|
- platform: neopixelbus
|
|
name: "Bindicator"
|
|
id: bindicator
|
|
variant: WS2812X
|
|
pin: 0
|
|
num_leds: 2
|
|
effects:
|
|
- lambda:
|
|
name: Pulsing
|
|
update_interval: 1s
|
|
lambda: |-
|
|
static int loopnum = 0;
|
|
auto call = id(bindicator).turn_on();
|
|
call.set_brightness(1);
|
|
call.set_transition_length(1000);
|
|
|
|
if (loopnum == 0) {
|
|
call.set_brightness(0.5);
|
|
} else if (loopnum == 1) {
|
|
call.set_brightness(1);
|
|
}
|
|
call.perform();
|
|
loopnum++;
|
|
if (loopnum == 30) loopnum = 0;
|
|
- platform: partition
|
|
name: "Bindicator - Bottom"
|
|
id: bindicatorbottom
|
|
segments:
|
|
- id: bindicator
|
|
from: 0
|
|
to: 0
|
|
effects:
|
|
- lambda:
|
|
name: Pulsing
|
|
update_interval: 1s
|
|
lambda: |-
|
|
static int loopnum = 0;
|
|
auto call = id(bindicatorbottom).turn_on();
|
|
call.set_brightness(1);
|
|
call.set_transition_length(1500);
|
|
|
|
if (loopnum == 0) {
|
|
call.set_brightness(0.5);
|
|
} else if (loopnum == 1) {
|
|
call.set_brightness(1);
|
|
}
|
|
call.perform();
|
|
loopnum++;
|
|
if (loopnum == 30) loopnum = 0;
|
|
|
|
- platform: partition
|
|
name: "Bindicator - Top"
|
|
id: bindicatortop
|
|
segments:
|
|
- id: bindicator
|
|
from: 1
|
|
to: 1
|
|
effects:
|
|
- lambda:
|
|
name: Pulsing
|
|
update_interval: 1s
|
|
lambda: |-
|
|
static int loopnum = 0;
|
|
auto call = id(bindicatortop).turn_on();
|
|
call.set_brightness(1);
|
|
call.set_transition_length(1500);
|
|
|
|
if (loopnum == 0) {
|
|
call.set_brightness(0.5);
|
|
} else if (loopnum == 1) {
|
|
call.set_brightness(1);
|
|
}
|
|
call.perform();
|
|
loopnum++;
|
|
if (loopnum == 30) loopnum = 0; |