mirror of
https://github.com/esphome/esphome.git
synced 2025-09-01 10:52:19 +01:00
Add runtime online image support (#4710)
This commit is contained in:
18
tests/components/online_image/common-esp32.yaml
Normal file
18
tests/components/online_image/common-esp32.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
<<: !include common.yaml
|
||||
|
||||
spi:
|
||||
- id: spi_main_lcd
|
||||
clk_pin: 16
|
||||
mosi_pin: 17
|
||||
miso_pin: 15
|
||||
|
||||
display:
|
||||
- platform: ili9xxx
|
||||
id: main_lcd
|
||||
model: ili9342
|
||||
cs_pin: 12
|
||||
dc_pin: 13
|
||||
reset_pin: 21
|
||||
lambda: |-
|
||||
it.fill(Color(0, 0, 0));
|
||||
it.image(0, 0, id(online_rgba_image));
|
18
tests/components/online_image/common-esp8266.yaml
Normal file
18
tests/components/online_image/common-esp8266.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
<<: !include common.yaml
|
||||
|
||||
spi:
|
||||
- id: spi_main_lcd
|
||||
clk_pin: 14
|
||||
mosi_pin: 13
|
||||
miso_pin: 12
|
||||
|
||||
display:
|
||||
- platform: ili9xxx
|
||||
id: main_lcd
|
||||
model: ili9342
|
||||
cs_pin: 15
|
||||
dc_pin: 3
|
||||
reset_pin: 1
|
||||
lambda: |-
|
||||
it.fill(Color(0, 0, 0));
|
||||
it.image(0, 0, id(online_rgba_image));
|
37
tests/components/online_image/common.yaml
Normal file
37
tests/components/online_image/common.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
wifi:
|
||||
ssid: MySSID
|
||||
password: password1
|
||||
|
||||
# Purposely test that `online_image:` does auto-load `image:`
|
||||
# Keep the `image:` undefined.
|
||||
# image:
|
||||
online_image:
|
||||
- id: online_binary_image
|
||||
url: http://www.libpng.org/pub/png/img_png/pnglogo-blk-tiny.png
|
||||
format: PNG
|
||||
type: BINARY
|
||||
resize: 50x50
|
||||
- id: online_binary_transparent_image
|
||||
url: http://www.libpng.org/pub/png/img_png/pnglogo-blk-tiny.png
|
||||
type: TRANSPARENT_BINARY
|
||||
format: png
|
||||
- id: online_rgba_image
|
||||
url: http://www.libpng.org/pub/png/img_png/pnglogo-blk-tiny.png
|
||||
format: PNG
|
||||
type: RGBA
|
||||
- id: online_rgb24_image
|
||||
url: http://www.libpng.org/pub/png/img_png/pnglogo-blk-tiny.png
|
||||
format: PNG
|
||||
type: RGB24
|
||||
use_transparency: true
|
||||
|
||||
# Check the set_url action
|
||||
time:
|
||||
- platform: sntp
|
||||
on_time:
|
||||
- at: "13:37:42"
|
||||
then:
|
||||
- online_image.set_url:
|
||||
id: online_rgba_image
|
||||
url: http://www.example.org/example.png
|
||||
|
4
tests/components/online_image/test.esp32-ard.yaml
Normal file
4
tests/components/online_image/test.esp32-ard.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
<<: !include common-esp32.yaml
|
||||
|
||||
http_request:
|
||||
verify_ssl: false
|
4
tests/components/online_image/test.esp32-idf.yaml
Normal file
4
tests/components/online_image/test.esp32-idf.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
<<: !include common-esp32.yaml
|
||||
|
||||
http_request:
|
||||
|
Reference in New Issue
Block a user