mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 05:24:53 +01:00
Create `component_dir
` substitution for local files to be included in… (#6575)
This commit is contained in:
parent
655dbc48b5
commit
45ae78de03
21 changed files with 87 additions and 128 deletions
|
@ -58,7 +58,7 @@ file_types = (
|
|||
)
|
||||
cpp_include = ("*.h", "*.c", "*.cpp", "*.tcc")
|
||||
py_include = ("*.py",)
|
||||
ignore_types = (".ico", ".png", ".woff", ".woff2", "")
|
||||
ignore_types = (".ico", ".png", ".woff", ".woff2", "", ".ttf", ".otf")
|
||||
|
||||
LINT_FILE_CHECKS = []
|
||||
LINT_CONTENT_CHECKS = []
|
||||
|
|
BIN
tests/components/font/Monocraft.ttf
Normal file
BIN
tests/components/font/Monocraft.ttf
Normal file
Binary file not shown.
38
tests/components/font/common.yaml
Normal file
38
tests/components/font/common.yaml
Normal file
|
@ -0,0 +1,38 @@
|
|||
font:
|
||||
- file: "gfonts://Roboto"
|
||||
id: roboto
|
||||
size: 20
|
||||
glyphs: "0123456789."
|
||||
extras:
|
||||
- file: "gfonts://Roboto"
|
||||
glyphs: ["\u00C4", "\u00C5", "\U000000C7"]
|
||||
- file: "gfonts://Roboto"
|
||||
id: roboto_web
|
||||
size: 20
|
||||
- file: "https://github.com/IdreesInc/Monocraft/releases/download/v3.0/Monocraft.ttf"
|
||||
id: monocraft
|
||||
size: 20
|
||||
- file:
|
||||
type: web
|
||||
url: "https://github.com/IdreesInc/Monocraft/releases/download/v3.0/Monocraft.ttf"
|
||||
id: monocraft2
|
||||
size: 24
|
||||
- file: $component_dir/Monocraft.ttf
|
||||
id: monocraft3
|
||||
size: 28
|
||||
|
||||
i2c:
|
||||
scl: ${i2c_scl}
|
||||
sda: ${i2c_sda}
|
||||
|
||||
display:
|
||||
- platform: ssd1306_i2c
|
||||
id: ssd1306_display
|
||||
model: SSD1306_128X64
|
||||
reset_pin: ${display_reset_pin}
|
||||
lambda: |-
|
||||
it.print(0, 0, id(roboto), "Hello, World!");
|
||||
it.print(0, 20, id(roboto_web), "Hello, World!");
|
||||
it.print(0, 40, id(monocraft), "Hello, World!");
|
||||
it.print(0, 60, id(monocraft2), "Hello, World!");
|
||||
it.print(0, 80, id(monocraft3), "Hello, World!");
|
|
@ -1,19 +1,7 @@
|
|||
i2c:
|
||||
- id: i2c_font
|
||||
scl: 5
|
||||
sda: 4
|
||||
substitutions:
|
||||
i2c_scl: GPIO5
|
||||
i2c_sda: GPIO4
|
||||
display_reset_pin: GPIO3
|
||||
|
||||
display:
|
||||
- platform: ssd1306_i2c
|
||||
id: ssd1306_display
|
||||
model: SSD1306_128X64
|
||||
reset_pin: 3
|
||||
pages:
|
||||
- id: page1
|
||||
lambda: |-
|
||||
it.rectangle(0, 0, it.get_width(), it.get_height());
|
||||
|
||||
font:
|
||||
- file: "gfonts://Roboto"
|
||||
id: roboto
|
||||
size: 20
|
||||
packages:
|
||||
common: !include common.yaml
|
||||
|
|
|
@ -1,19 +1,7 @@
|
|||
i2c:
|
||||
- id: i2c_font
|
||||
scl: 5
|
||||
sda: 4
|
||||
substitutions:
|
||||
i2c_scl: GPIO5
|
||||
i2c_sda: GPIO4
|
||||
display_reset_pin: GPIO3
|
||||
|
||||
display:
|
||||
- platform: ssd1306_i2c
|
||||
id: ssd1306_display
|
||||
model: SSD1306_128X64
|
||||
reset_pin: 3
|
||||
pages:
|
||||
- id: page1
|
||||
lambda: |-
|
||||
it.rectangle(0, 0, it.get_width(), it.get_height());
|
||||
|
||||
font:
|
||||
- file: "gfonts://Roboto"
|
||||
id: roboto
|
||||
size: 20
|
||||
packages:
|
||||
common: !include common.yaml
|
||||
|
|
|
@ -1,19 +1,7 @@
|
|||
i2c:
|
||||
- id: i2c_font
|
||||
scl: 16
|
||||
sda: 17
|
||||
substitutions:
|
||||
i2c_scl: GPIO16
|
||||
i2c_sda: GPIO17
|
||||
display_reset_pin: GPIO13
|
||||
|
||||
display:
|
||||
- platform: ssd1306_i2c
|
||||
id: ssd1306_display
|
||||
model: SSD1306_128X64
|
||||
reset_pin: 13
|
||||
pages:
|
||||
- id: page1
|
||||
lambda: |-
|
||||
it.rectangle(0, 0, it.get_width(), it.get_height());
|
||||
|
||||
font:
|
||||
- file: "gfonts://Roboto"
|
||||
id: roboto
|
||||
size: 20
|
||||
packages:
|
||||
common: !include common.yaml
|
||||
|
|
|
@ -1,38 +1,7 @@
|
|||
font:
|
||||
- file: "gfonts://Roboto"
|
||||
id: roboto
|
||||
size: 20
|
||||
glyphs: "0123456789."
|
||||
extras:
|
||||
- file: "gfonts://Roboto"
|
||||
glyphs: ["\u00C4", "\u00C5", "\U000000C7"]
|
||||
- file: "gfonts://Roboto"
|
||||
id: roboto_web
|
||||
size: 20
|
||||
- file: "https://github.com/IdreesInc/Monocraft/releases/download/v3.0/Monocraft.ttf"
|
||||
id: monocraft
|
||||
size: 20
|
||||
- file:
|
||||
type: web
|
||||
url: "https://github.com/IdreesInc/Monocraft/releases/download/v3.0/Monocraft.ttf"
|
||||
id: monocraft2
|
||||
size: 24
|
||||
|
||||
spi:
|
||||
clk_pin: 14
|
||||
mosi_pin: 13
|
||||
|
||||
display:
|
||||
- id: my_display
|
||||
platform: ili9xxx
|
||||
dimensions: 480x320
|
||||
model: ST7796
|
||||
cs_pin: 15
|
||||
dc_pin: 21
|
||||
reset_pin: 22
|
||||
transform:
|
||||
swap_xy: true
|
||||
mirror_x: true
|
||||
mirror_y: true
|
||||
auto_clear_enabled: false
|
||||
substitutions:
|
||||
i2c_scl: GPIO16
|
||||
i2c_sda: GPIO17
|
||||
display_reset_pin: GPIO13
|
||||
|
||||
packages:
|
||||
common: !include common.yaml
|
||||
|
|
|
@ -1,19 +1,7 @@
|
|||
i2c:
|
||||
- id: i2c_font
|
||||
scl: 5
|
||||
sda: 4
|
||||
substitutions:
|
||||
i2c_scl: GPIO5
|
||||
i2c_sda: GPIO4
|
||||
display_reset_pin: GPIO3
|
||||
|
||||
display:
|
||||
- platform: ssd1306_i2c
|
||||
id: ssd1306_display
|
||||
model: SSD1306_128X64
|
||||
reset_pin: 3
|
||||
pages:
|
||||
- id: page1
|
||||
lambda: |-
|
||||
it.rectangle(0, 0, it.get_width(), it.get_height());
|
||||
|
||||
font:
|
||||
- file: "gfonts://Roboto"
|
||||
id: roboto
|
||||
size: 20
|
||||
packages:
|
||||
common: !include common.yaml
|
||||
|
|
|
@ -1,19 +1,7 @@
|
|||
i2c:
|
||||
- id: i2c_font
|
||||
scl: 5
|
||||
sda: 4
|
||||
substitutions:
|
||||
i2c_scl: GPIO5
|
||||
i2c_sda: GPIO4
|
||||
display_reset_pin: GPIO3
|
||||
|
||||
display:
|
||||
- platform: ssd1306_i2c
|
||||
id: ssd1306_display
|
||||
model: SSD1306_128X64
|
||||
reset_pin: 3
|
||||
pages:
|
||||
- id: page1
|
||||
lambda: |-
|
||||
it.rectangle(0, 0, it.get_width(), it.get_height());
|
||||
|
||||
font:
|
||||
- file: "gfonts://Roboto"
|
||||
id: roboto
|
||||
size: 20
|
||||
packages:
|
||||
common: !include common.yaml
|
||||
|
|
|
@ -16,3 +16,4 @@ packages:
|
|||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -18,3 +18,4 @@ packages:
|
|||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -18,3 +18,4 @@ packages:
|
|||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -18,3 +18,4 @@ packages:
|
|||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -18,3 +18,4 @@ packages:
|
|||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -19,3 +19,4 @@ packages:
|
|||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -19,3 +19,4 @@ packages:
|
|||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -19,3 +19,4 @@ packages:
|
|||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -19,3 +19,4 @@ packages:
|
|||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -16,3 +16,4 @@ packages:
|
|||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -16,3 +16,4 @@ packages:
|
|||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -19,3 +19,4 @@ packages:
|
|||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
Loading…
Reference in a new issue