Txs for getting back.
Yaml file
esphome:
name: ssd1306-display
platform: ESP8266
board: nodemcuv2
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: "<password>"
wifi:
ssid: "<ssid>"
password: "<password>"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "<fallback ssid>"
password: "<fallback password>"
captive_portal:
time:
- platform: homeassistant
id: esptime
image:
- file: "image.png"
id: my_image
resize: 60x60
animation:
- file: "walk-animation.gif"
id: my_animation
resize: 50x50
font:
- file: "Amiko-Regular.ttf"
id: font1
size: 10
- file: "Amiko-Bold.ttf"
id: font2
size: 14
- file: "Amiko-SemiBold.ttf"
id: font3
size: 10
# Configuration for SSD1306
i2c:
sda: D1
scl: D2
display:
- platform: ssd1306_i2c
model: "SSD1306 128x64"
reset_pin: D0
address: 0x3C
brightness: 50%
lambda: |-
it.strftime(64, 8, id(font1), TextAlign::CENTER, "%H:%M", id(esptime).now());
it.print(0, 0, id(font1), "Time ");
it.print(0, 54, id(font3), "Hello World!");
// Draw a line from [97,0] to [110,50]
it.line(97, 0, 115, 50);
// Circles! Let's draw one with the center at [25,25] and a radius of 10
it.circle(117, 25, 10);
// Draw the image my_image at position [x=0,y=0]
it.image(0, 25, id(my_image));
//Ingress shown animation Frame.
id(my_animation).next_frame();
// Draw the animation my_animation at position [x=0,y=0]
it.image(0, 0, id(my_animation), COLOR_ON, COLOR_OFF);
Output
INFO Reading configuration /config/esphome/ssd1306-display.yaml...
INFO Detected timezone 'AEST' with UTC offset 10 and daylight saving time from 03 October 02:00:00 to 03 April 03:00:00
INFO Generating C++ source...
Traceback (most recent call last):
File "/usr/local/bin/esphome", line 33, in <module>
sys.exit(load_entry_point('esphome', 'console_scripts', 'esphome')())
File "/opt/esphome/esphome/__main__.py", line 760, in main
return run_esphome(sys.argv)
File "/opt/esphome/esphome/__main__.py", line 747, in run_esphome
rc = POST_CONFIG_ACTIONS[args.command](args, config)
File "/opt/esphome/esphome/__main__.py", line 343, in command_run
exit_code = write_cpp(config)
File "/opt/esphome/esphome/__main__.py", line 156, in write_cpp
generate_cpp_contents(config)
File "/opt/esphome/esphome/__main__.py", line 168, in generate_cpp_contents
CORE.flush_tasks()
File "/opt/esphome/esphome/core/__init__.py", line 616, in flush_tasks
self.event_loop.flush_tasks()
File "/opt/esphome/esphome/coroutine.py", line 245, in flush_tasks
next(task.iterator)
File "/opt/esphome/esphome/__main__.py", line 148, in wrapped
await coro(conf)
File "/opt/esphome/esphome/components/animation/__init__.py", line 89, in to_code
frame = image.convert("1", dither=Image.NONE)
File "/usr/lib/python3/dist-packages/PIL/Image.py", line 915, in convert
self.load()
File "/usr/lib/python3/dist-packages/PIL/ImageFile.py", line 215, in load
decoder.setimage(self.im, extents)
ValueError: tile cannot extend outside image