mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 00:18:11 +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")
|
cpp_include = ("*.h", "*.c", "*.cpp", "*.tcc")
|
||||||
py_include = ("*.py",)
|
py_include = ("*.py",)
|
||||||
ignore_types = (".ico", ".png", ".woff", ".woff2", "")
|
ignore_types = (".ico", ".png", ".woff", ".woff2", "", ".ttf", ".otf")
|
||||||
|
|
||||||
LINT_FILE_CHECKS = []
|
LINT_FILE_CHECKS = []
|
||||||
LINT_CONTENT_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:
|
substitutions:
|
||||||
- id: i2c_font
|
i2c_scl: GPIO5
|
||||||
scl: 5
|
i2c_sda: GPIO4
|
||||||
sda: 4
|
display_reset_pin: GPIO3
|
||||||
|
|
||||||
display:
|
packages:
|
||||||
- platform: ssd1306_i2c
|
common: !include common.yaml
|
||||||
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
|
|
||||||
|
|
|
@ -1,19 +1,7 @@
|
||||||
i2c:
|
substitutions:
|
||||||
- id: i2c_font
|
i2c_scl: GPIO5
|
||||||
scl: 5
|
i2c_sda: GPIO4
|
||||||
sda: 4
|
display_reset_pin: GPIO3
|
||||||
|
|
||||||
display:
|
packages:
|
||||||
- platform: ssd1306_i2c
|
common: !include common.yaml
|
||||||
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
|
|
||||||
|
|
|
@ -1,19 +1,7 @@
|
||||||
i2c:
|
substitutions:
|
||||||
- id: i2c_font
|
i2c_scl: GPIO16
|
||||||
scl: 16
|
i2c_sda: GPIO17
|
||||||
sda: 17
|
display_reset_pin: GPIO13
|
||||||
|
|
||||||
display:
|
packages:
|
||||||
- platform: ssd1306_i2c
|
common: !include common.yaml
|
||||||
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
|
|
||||||
|
|
|
@ -1,38 +1,7 @@
|
||||||
font:
|
substitutions:
|
||||||
- file: "gfonts://Roboto"
|
i2c_scl: GPIO16
|
||||||
id: roboto
|
i2c_sda: GPIO17
|
||||||
size: 20
|
display_reset_pin: GPIO13
|
||||||
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
|
|
||||||
|
|
||||||
|
packages:
|
||||||
|
common: !include common.yaml
|
||||||
|
|
|
@ -1,19 +1,7 @@
|
||||||
i2c:
|
substitutions:
|
||||||
- id: i2c_font
|
i2c_scl: GPIO5
|
||||||
scl: 5
|
i2c_sda: GPIO4
|
||||||
sda: 4
|
display_reset_pin: GPIO3
|
||||||
|
|
||||||
display:
|
packages:
|
||||||
- platform: ssd1306_i2c
|
common: !include common.yaml
|
||||||
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
|
|
||||||
|
|
|
@ -1,19 +1,7 @@
|
||||||
i2c:
|
substitutions:
|
||||||
- id: i2c_font
|
i2c_scl: GPIO5
|
||||||
scl: 5
|
i2c_sda: GPIO4
|
||||||
sda: 4
|
display_reset_pin: GPIO3
|
||||||
|
|
||||||
display:
|
packages:
|
||||||
- platform: ssd1306_i2c
|
common: !include common.yaml
|
||||||
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
|
|
||||||
|
|
|
@ -16,3 +16,4 @@ packages:
|
||||||
test_name: $test_name
|
test_name: $test_name
|
||||||
target_platform: $target_platform
|
target_platform: $target_platform
|
||||||
component_test_file: $component_test_file
|
component_test_file: $component_test_file
|
||||||
|
component_dir: "../../components/$component_name"
|
||||||
|
|
|
@ -18,3 +18,4 @@ packages:
|
||||||
test_name: $test_name
|
test_name: $test_name
|
||||||
target_platform: $target_platform
|
target_platform: $target_platform
|
||||||
component_test_file: $component_test_file
|
component_test_file: $component_test_file
|
||||||
|
component_dir: "../../components/$component_name"
|
||||||
|
|
|
@ -18,3 +18,4 @@ packages:
|
||||||
test_name: $test_name
|
test_name: $test_name
|
||||||
target_platform: $target_platform
|
target_platform: $target_platform
|
||||||
component_test_file: $component_test_file
|
component_test_file: $component_test_file
|
||||||
|
component_dir: "../../components/$component_name"
|
||||||
|
|
|
@ -18,3 +18,4 @@ packages:
|
||||||
test_name: $test_name
|
test_name: $test_name
|
||||||
target_platform: $target_platform
|
target_platform: $target_platform
|
||||||
component_test_file: $component_test_file
|
component_test_file: $component_test_file
|
||||||
|
component_dir: "../../components/$component_name"
|
||||||
|
|
|
@ -18,3 +18,4 @@ packages:
|
||||||
test_name: $test_name
|
test_name: $test_name
|
||||||
target_platform: $target_platform
|
target_platform: $target_platform
|
||||||
component_test_file: $component_test_file
|
component_test_file: $component_test_file
|
||||||
|
component_dir: "../../components/$component_name"
|
||||||
|
|
|
@ -19,3 +19,4 @@ packages:
|
||||||
test_name: $test_name
|
test_name: $test_name
|
||||||
target_platform: $target_platform
|
target_platform: $target_platform
|
||||||
component_test_file: $component_test_file
|
component_test_file: $component_test_file
|
||||||
|
component_dir: "../../components/$component_name"
|
||||||
|
|
|
@ -19,3 +19,4 @@ packages:
|
||||||
test_name: $test_name
|
test_name: $test_name
|
||||||
target_platform: $target_platform
|
target_platform: $target_platform
|
||||||
component_test_file: $component_test_file
|
component_test_file: $component_test_file
|
||||||
|
component_dir: "../../components/$component_name"
|
||||||
|
|
|
@ -19,3 +19,4 @@ packages:
|
||||||
test_name: $test_name
|
test_name: $test_name
|
||||||
target_platform: $target_platform
|
target_platform: $target_platform
|
||||||
component_test_file: $component_test_file
|
component_test_file: $component_test_file
|
||||||
|
component_dir: "../../components/$component_name"
|
||||||
|
|
|
@ -19,3 +19,4 @@ packages:
|
||||||
test_name: $test_name
|
test_name: $test_name
|
||||||
target_platform: $target_platform
|
target_platform: $target_platform
|
||||||
component_test_file: $component_test_file
|
component_test_file: $component_test_file
|
||||||
|
component_dir: "../../components/$component_name"
|
||||||
|
|
|
@ -16,3 +16,4 @@ packages:
|
||||||
test_name: $test_name
|
test_name: $test_name
|
||||||
target_platform: $target_platform
|
target_platform: $target_platform
|
||||||
component_test_file: $component_test_file
|
component_test_file: $component_test_file
|
||||||
|
component_dir: "../../components/$component_name"
|
||||||
|
|
|
@ -16,3 +16,4 @@ packages:
|
||||||
test_name: $test_name
|
test_name: $test_name
|
||||||
target_platform: $target_platform
|
target_platform: $target_platform
|
||||||
component_test_file: $component_test_file
|
component_test_file: $component_test_file
|
||||||
|
component_dir: "../../components/$component_name"
|
||||||
|
|
|
@ -19,3 +19,4 @@ packages:
|
||||||
test_name: $test_name
|
test_name: $test_name
|
||||||
target_platform: $target_platform
|
target_platform: $target_platform
|
||||||
component_test_file: $component_test_file
|
component_test_file: $component_test_file
|
||||||
|
component_dir: "../../components/$component_name"
|
||||||
|
|
Loading…
Reference in a new issue