feat: wordclock works!
This commit is contained in:
parent
5b0930d616
commit
7f091409cf
8 changed files with 1405 additions and 12 deletions
225
image_test_3leds.yaml
Normal file
225
image_test_3leds.yaml
Normal file
|
|
@ -0,0 +1,225 @@
|
|||
esphome:
|
||||
name: "display-thing"
|
||||
# on_boot:
|
||||
# priority: 600
|
||||
# # ...
|
||||
# then:
|
||||
# - light.turn_on:
|
||||
# id: neopixel_strip_1
|
||||
# brightness: 100%
|
||||
# effect: random_twinkle
|
||||
|
||||
esp8266:
|
||||
board: d1_mini
|
||||
framework:
|
||||
version: recommended
|
||||
|
||||
external_components:
|
||||
- source:
|
||||
type: local
|
||||
path: components
|
||||
components: [ wordclock ]
|
||||
# components: [ wordclock, addressable_light ]
|
||||
|
||||
wifi:
|
||||
ssid: !secret wifi_ssid
|
||||
password: !secret wifi_password
|
||||
ap:
|
||||
ssid: "WordClock Configuration"
|
||||
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
|
||||
|
||||
captive_portal:
|
||||
|
||||
api:
|
||||
|
||||
ota:
|
||||
password: "wordclock"
|
||||
|
||||
logger:
|
||||
# esp8266_store_log_strings_in_flash: false
|
||||
# web_server:
|
||||
# port: 80
|
||||
|
||||
time:
|
||||
- platform: sntp
|
||||
id: current_time
|
||||
timezone: !secret timezone
|
||||
on_time_sync:
|
||||
then:
|
||||
- logger.log: "synced system clock"
|
||||
# - light.turn_on:
|
||||
# id: neopixel_strip_1
|
||||
# effect: "None"
|
||||
# - light.turn_off:
|
||||
# id: neopixel_strip_1
|
||||
light:
|
||||
- name: NeoPixel Strip 1
|
||||
id: neopixel_strip_1
|
||||
platform: neopixelbus
|
||||
type: GRB
|
||||
variant: WS2812
|
||||
pin: GPIO3
|
||||
num_leds: 198
|
||||
restore_mode: ALWAYS_OFF
|
||||
# default_transition_length: 0.7s
|
||||
# color_correct: [100%, 100%, 100%]
|
||||
method:
|
||||
type: esp8266_dma
|
||||
|
||||
effects:
|
||||
# - random:
|
||||
# - pulse:
|
||||
# - strobe:
|
||||
# - flicker:
|
||||
- addressable_rainbow:
|
||||
name: "rainbow"
|
||||
# - addressable_color_wipe:
|
||||
# - addressable_scan:
|
||||
- addressable_twinkle:
|
||||
name: "twinkle"
|
||||
- addressable_random_twinkle:
|
||||
name: "random_twinkle"
|
||||
# - addressable_fireworks:
|
||||
# - addressable_flicker:
|
||||
# - wled:
|
||||
|
||||
|
||||
display:
|
||||
- platform: addressable_light
|
||||
id: led_matrix_display
|
||||
addressable_light_id: neopixel_strip_1
|
||||
width: 18
|
||||
height: 11
|
||||
rotation: 270°
|
||||
update_interval: 16ms
|
||||
auto_clear_enabled: false
|
||||
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];
|
||||
}
|
||||
# lambda: |-
|
||||
# //ESP_LOGE("lambda", "display_ptr: %i", &it);
|
||||
# //it.fill(Color(0xff00ff));
|
||||
# //it.line(0,0,0,0, Color(0x00FF00));
|
||||
|
||||
|
||||
wordclock:
|
||||
time_id: current_time
|
||||
display_id: led_matrix_display
|
||||
addressable_light_id: neopixel_strip_1
|
||||
static_segments: ["IT", "IS"]
|
||||
segments:
|
||||
- {name: "IT", line: {x1: 0, x2: 1, y1: 0}}
|
||||
- {name: "IS", line: {x1: 3, x2: 4, y1: 0}}
|
||||
- {name: "AM", line: {x1: 7, x2: 8, y1: 0}}
|
||||
- {name: "PM", line: {x1: 9, x2: 10, y1: 0}}
|
||||
- {name: "QUARTER", line: {x1: 2, x2: 8, y1: 1}}
|
||||
- {name: "TWENTY", line: {x1: 0, x2: 5, y1: 2}}
|
||||
- {name: "FIVE_MINUTES", line: {x1: 6, x2: 9, y1: 2}}
|
||||
- {name: "HALF", line: {x1: 0, x2: 3, y1: 3}}
|
||||
- {name: "TEN_MINUTES", line: {x1: 5, x2: 7, y1: 3}}
|
||||
- {name: "TO", line: {x1: 9, x2: 10, y1: 3}}
|
||||
- {name: "PAST", line: {x1: 0, x2: 3, y1: 4}}
|
||||
- {name: "NINE", line: {x1: 7, x2: 10, y1: 4}}
|
||||
- {name: "ONE", line: {x1: 0, x2: 2, y1: 5}}
|
||||
- {name: "SIX", line: {x1: 3, x2: 5, y1: 5}}
|
||||
- {name: "THREE", line: {x1: 6, x2: 10, y1: 5}}
|
||||
- {name: "FOUR", line: {x1: 0, x2: 3, y1: 6}}
|
||||
- {name: "FIVE", line: {x1: 4, x2: 7, y1: 6}}
|
||||
- {name: "TWO", line: {x1: 8, x2: 10, y1: 6}}
|
||||
- {name: "EIGHT", line: {x1: 0, x2: 4, y1: 7}}
|
||||
- {name: "ELEVEN", line: {x1: 5, x2: 10, y1: 7}}
|
||||
- {name: "SEVEN", line: {x1: 0, x2: 4, y1: 8}}
|
||||
- {name: "TWELVE", line: {x1: 5, x2: 10, y1: 8}}
|
||||
- {name: "TEN", line: {x1: 0, x2: 2, y1: 9}}
|
||||
- {name: "OCLOCK", line: {x1: 5, x2: 10, y1: 9}}
|
||||
minutes:
|
||||
- {minute: 0, hour_offset: 0, segments: ["OCLOCK"]}
|
||||
- {minute: 5, hour_offset: 0, segments: ["FIVE_MINUTES", "PAST"]}
|
||||
- {minute: 10, hour_offset: 0, segments: ["TEN_MINUTES", "PAST"]}
|
||||
- {minute: 15, hour_offset: 0, segments: ["QUARTER", "PAST"]}
|
||||
- {minute: 20, hour_offset: 0, segments: ["TWENTY", "PAST"]}
|
||||
- {minute: 25, hour_offset: 0, segments: ["TWENTY", "FIVE_MINUTES", "PAST"]}
|
||||
- {minute: 30, hour_offset: 0, segments: ["HALF", "PAST"]}
|
||||
- {minute: 35, hour_offset: 1, segments: ["TWENTY", "FIVE_MINUTES", "TO"]}
|
||||
- {minute: 40, hour_offset: 1, segments: ["TWENTY", "TO"]}
|
||||
- {minute: 45, hour_offset: 1, segments: ["QUARTER", "TO"]}
|
||||
- {minute: 50, hour_offset: 1, segments: ["TEN_MINUTES", "TO"]}
|
||||
- {minute: 55, hour_offset: 1, segments: ["FIVE_MINUTES", "TO"]}
|
||||
hours:
|
||||
- {hour: 0, segments: "TWELVE"}
|
||||
- {hour: 1, segments: "ONE"}
|
||||
- {hour: 2, segments: "TWO"}
|
||||
- {hour: 3, segments: "THREE"}
|
||||
- {hour: 4, segments: "FOUR"}
|
||||
- {hour: 5, segments: "FIVE"}
|
||||
- {hour: 6, segments: "SIX"}
|
||||
- {hour: 7, segments: "SEVEN"}
|
||||
- {hour: 8, segments: "EIGHT"}
|
||||
- {hour: 9, segments: "NINE"}
|
||||
- {hour: 10, segments: "TEN"}
|
||||
- {hour: 11, segments: "ELEVEN"}
|
||||
- {hour: 12, segments: "TWELVE"}
|
||||
- {hour: 13, segments: "ONE"}
|
||||
- {hour: 14, segments: "TWO"}
|
||||
- {hour: 15, segments: "THREE"}
|
||||
- {hour: 16, segments: "FOUR"}
|
||||
- {hour: 17, segments: "FIVE"}
|
||||
- {hour: 18, segments: "SIX"}
|
||||
- {hour: 19, segments: "SEVEN"}
|
||||
- {hour: 20, segments: "EIGHT"}
|
||||
- {hour: 21, segments: "NINE"}
|
||||
- {hour: 22, segments: "TEN"}
|
||||
- {hour: 23, segments: "ELEVEN"}
|
||||
# hours:
|
||||
# - {hour: 0, segments: ["TWELVE", "AM"]}
|
||||
# - {hour: 1, segments: ["ONE", "AM"]}
|
||||
# - {hour: 2, segments: ["TWO", "AM"]}
|
||||
# - {hour: 3, segments: ["THREE", "AM"]}
|
||||
# - {hour: 4, segments: ["FOUR", "AM"]}
|
||||
# - {hour: 5, segments: ["FIVE", "AM"]}
|
||||
# - {hour: 6, segments: ["SIX", "AM"]}
|
||||
# - {hour: 7, segments: ["SEVEN", "AM"]}
|
||||
# - {hour: 8, segments: ["EIGHT", "AM"]}
|
||||
# - {hour: 9, segments: ["NINE", "AM"]}
|
||||
# - {hour: 10, segments: ["TEN", "AM"]}
|
||||
# - {hour: 11, segments: ["ELEVEN", "AM"]}
|
||||
# - {hour: 12, segments: ["TWELVE", "PM"]}
|
||||
# - {hour: 13, segments: ["ONE", "PM"]}
|
||||
# - {hour: 14, segments: ["TWO", "PM"]}
|
||||
# - {hour: 15, segments: ["THREE", "PM"]}
|
||||
# - {hour: 16, segments: ["FOUR", "PM"]}
|
||||
# - {hour: 17, segments: ["FIVE", "PM"]}
|
||||
# - {hour: 18, segments: ["SIX", "PM"]}
|
||||
# - {hour: 19, segments: ["SEVEN", "PM"]}
|
||||
# - {hour: 20, segments: ["EIGHT", "PM"]}
|
||||
# - {hour: 21, segments: ["NINE", "PM"]}
|
||||
# - {hour: 22, segments: ["TEN", "PM"]}
|
||||
# - {hour: 23, segments: ["ELEVEN", "PM"]}
|
||||
# minutes:
|
||||
# - {minute: 0, segments: ["A"]}
|
||||
# - {minute: 5, segments: ["B"]}
|
||||
# - {minute: 10, segments: ["A"]}
|
||||
# - {minute: 15, segments: ["B"]}
|
||||
# - {minute: 20, segments: ["A"]}
|
||||
# - {minute: 25, segments: ["B"]}
|
||||
# - {minute: 30, segments: ["A"]}
|
||||
# - {minute: 35, segments: ["B"]}
|
||||
# - {minute: 40, segments: ["A"]}
|
||||
# - {minute: 45, segments: ["B"]}
|
||||
# - {minute: 50, segments: ["A"]}
|
||||
# - {minute: 55, segments: ["B"]}
|
||||
# hours:
|
||||
# - {hour: 0, segments: ["C"]}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue