98 lines
2.6 KiB
YAML
98 lines
2.6 KiB
YAML
esphome:
|
|
name: "display-thing"
|
|
|
|
esp8266:
|
|
board: d1_mini
|
|
framework:
|
|
version: recommended
|
|
|
|
wifi:
|
|
ssid: !secret wifi_ssid
|
|
password: !secret wifi_password
|
|
ap:
|
|
ssid: "${devicename}"
|
|
password: !secret ap_password
|
|
manual_ip:
|
|
static_ip: !secret manualip_static_ip
|
|
gateway: !secret manualip_gateway
|
|
subnet: !secret manualip_subnet
|
|
dns1: 1.1.1.1
|
|
dns2: 1.0.0.1
|
|
|
|
api:
|
|
|
|
ota:
|
|
password: "${devicename}"
|
|
|
|
logger:
|
|
# esp8266_store_log_strings_in_flash: false
|
|
# web_server:
|
|
# port: 80
|
|
|
|
light:
|
|
- name: NeoPixel Strip 1
|
|
id: neopixel_strip_1
|
|
platform: neopixelbus
|
|
type: GRB
|
|
variant: WS2812
|
|
pin: GPIO3
|
|
num_leds: 199
|
|
restore_mode: ALWAYS_ON
|
|
default_transition_length: 0s
|
|
color_correct: [100%, 100%, 100%]
|
|
method:
|
|
type: esp8266_dma
|
|
|
|
display:
|
|
- platform: addressable_light
|
|
id: led_matrix_display
|
|
addressable_light_id: neopixel_strip_1
|
|
width: 18
|
|
height: 11
|
|
rotation: 270°
|
|
update_interval: 16ms
|
|
pixel_mapper: |-
|
|
int mapping_even[] = {0, 2, 4, 6,8,10,11,13,15,17, 16,16,16,16, 16,16,16,16};
|
|
int mapping_odd[] = {17,15,13,11,9, 7, 6, 4, 2, 0, 16,16,16,16, 16,16,16,16};
|
|
if (x > 9) return -1;
|
|
if (y % 2 == 0) {
|
|
return (y * 18 + mapping_even[x]); // mapping_even[y];
|
|
} else {
|
|
return (y * 18 + mapping_odd[x]); // mapping_odd[y];
|
|
//return (y * 18 + 17 - x); // mapping_odd[y];
|
|
}
|
|
//if (x % 2 == 0) {
|
|
// return (x * 8) + y;
|
|
//}
|
|
//return (x * 8) + (7 - y);
|
|
lambda: |-
|
|
Color red = Color(0xFF0000);
|
|
Color green = Color(0x00FF00);
|
|
Color blue = Color(0x0000FF);
|
|
Color turquoise = Color(0x00FFFF);
|
|
it.draw_pixel_at(0,0, green);
|
|
it.draw_pixel_at(10,0, red);
|
|
it.draw_pixel_at(0,9, turquoise);
|
|
it.draw_pixel_at(10,9, blue);
|
|
//it.line(0,0, 11,0, red);
|
|
//it.line(0,1, 11,1, green);
|
|
//it.line(0,2, 11,2, blue);
|
|
//it.line(0,3, 11,3, red);
|
|
//it.line(0,4, 11,4, green);
|
|
//it.line(0,5, 11,5, blue);
|
|
//it.line(0,6, 11,6, red);
|
|
//it.line(0,7, 11,7, green);
|
|
//it.line(0,8, 11,8, blue);
|
|
//it.line(0,9, 11,9, red);
|
|
//it.line(0,10, 9,10, green);
|
|
//it.line(0,11, 9,11, blue);
|
|
// it.line(5,14, 10,14, green);
|
|
//it.rectangle(0, 0, 17, 10, red);
|
|
//it.rectangle(1, 1, 16, 9, green);
|
|
//it.rectangle(2, 2, 15, 8, blue);
|
|
//it.rectangle(3, 3, 14, 7, red);
|
|
|
|
time:
|
|
- platform: sntp
|
|
id: current_time
|
|
timezone: !secret timezone
|