mirror of
https://github.com/esphome/esphome.git
synced 2025-11-02 08:01:50 +00:00
Compare commits
19 Commits
2023.12.0b
...
2023.12.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b72a3a584 | ||
|
|
19e5a4a81a | ||
|
|
8e13c3e1b0 | ||
|
|
4f8e3211bf | ||
|
|
872519f7f6 | ||
|
|
2a69a49061 | ||
|
|
1a8e7854c7 | ||
|
|
6d3c7f035d | ||
|
|
00ab17cb8e | ||
|
|
2ee01e22cd | ||
|
|
cfa5e5c5a9 | ||
|
|
8675955614 | ||
|
|
816dcdf24f | ||
|
|
bec1ad9396 | ||
|
|
6a9e85438f | ||
|
|
ab25e32509 | ||
|
|
2ccf985de5 | ||
|
|
a64e96e7ad | ||
|
|
fbf3d03a33 |
@@ -50,7 +50,7 @@ RUN \
|
||||
libssl-dev=3.0.11-1~deb12u2 \
|
||||
libffi-dev=3.4.4-1 \
|
||||
libopenjp2-7=2.5.0-2 \
|
||||
libtiff6=4.5.0-6 \
|
||||
libtiff6=4.5.0-6+deb12u1 \
|
||||
cargo=0.66.0+ds1-1 \
|
||||
pkg-config=1.8.1-1 \
|
||||
gcc-arm-linux-gnueabihf=4:12.2.0-3; \
|
||||
|
||||
@@ -12,7 +12,7 @@ import argcomplete
|
||||
|
||||
from esphome import const, writer, yaml_util
|
||||
import esphome.codegen as cg
|
||||
from esphome.config import iter_components, read_config, strip_default_ids
|
||||
from esphome.config import iter_component_configs, read_config, strip_default_ids
|
||||
from esphome.const import (
|
||||
ALLOWED_NAME_CHARS,
|
||||
CONF_BAUD_RATE,
|
||||
@@ -196,7 +196,7 @@ def write_cpp(config):
|
||||
def generate_cpp_contents(config):
|
||||
_LOGGER.info("Generating C++ source...")
|
||||
|
||||
for name, component, conf in iter_components(CORE.config):
|
||||
for name, component, conf in iter_component_configs(CORE.config):
|
||||
if component.to_code is not None:
|
||||
coro = wrap_to_code(name, component)
|
||||
CORE.add_job(coro, conf)
|
||||
|
||||
@@ -74,7 +74,7 @@ void EKTF2232Touchscreen::update_touches() {
|
||||
uint8_t *d = raw + 1 + (i * 3);
|
||||
x_raw = (d[0] & 0xF0) << 4 | d[1];
|
||||
y_raw = (d[0] & 0x0F) << 8 | d[2];
|
||||
this->set_raw_touch_position_(i, x_raw, y_raw);
|
||||
this->add_raw_touch_position_(i, x_raw, y_raw);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -133,6 +133,10 @@ ESP32_BOARD_PINS = {
|
||||
"BUTTON": 0,
|
||||
"SWITCH": 0,
|
||||
},
|
||||
"airm2m_core_esp32c3": {
|
||||
"LED1_BUILTIN": 12,
|
||||
"LED2_BUILTIN": 13,
|
||||
},
|
||||
"alksesp32": {
|
||||
"A0": 32,
|
||||
"A1": 33,
|
||||
|
||||
@@ -94,7 +94,7 @@ class FT5x06Touchscreen : public touchscreen::Touchscreen, public i2c::I2CDevice
|
||||
|
||||
esph_log_d(TAG, "Read %X status, id: %d, pos %d/%d", status, id, x, y);
|
||||
if (status == 0 || status == 2) {
|
||||
this->set_raw_touch_position_(id, x, y);
|
||||
this->add_raw_touch_position_(id, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,13 +53,13 @@ void FT63X6Touchscreen::update_touches() {
|
||||
uint8_t touch_id = this->read_touch_id_(FT63X6_ADDR_TOUCH1_ID); // id1 = 0 or 1
|
||||
int16_t x = this->read_touch_coordinate_(FT63X6_ADDR_TOUCH1_X);
|
||||
int16_t y = this->read_touch_coordinate_(FT63X6_ADDR_TOUCH1_Y);
|
||||
this->set_raw_touch_position_(touch_id, x, y);
|
||||
this->add_raw_touch_position_(touch_id, x, y);
|
||||
|
||||
if (touch_count >= 2) {
|
||||
touch_id = this->read_touch_id_(FT63X6_ADDR_TOUCH2_ID); // id2 = 0 or 1(~id1 & 0x01)
|
||||
x = this->read_touch_coordinate_(FT63X6_ADDR_TOUCH2_X);
|
||||
y = this->read_touch_coordinate_(FT63X6_ADDR_TOUCH2_Y);
|
||||
this->set_raw_touch_position_(touch_id, x, y);
|
||||
this->add_raw_touch_position_(touch_id, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ void GT911Touchscreen::update_touches() {
|
||||
uint16_t id = data[i][0];
|
||||
uint16_t x = encode_uint16(data[i][2], data[i][1]);
|
||||
uint16_t y = encode_uint16(data[i][4], data[i][3]);
|
||||
this->set_raw_touch_position_(id, x, y);
|
||||
this->add_raw_touch_position_(id, x, y);
|
||||
}
|
||||
auto keys = data[num_of_touches][0];
|
||||
for (size_t i = 0; i != 4; i++) {
|
||||
|
||||
@@ -36,6 +36,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||
DOMAIN = "image"
|
||||
DEPENDENCIES = ["display"]
|
||||
MULTI_CONF = True
|
||||
MULTI_CONF_NO_DEFAULT = True
|
||||
|
||||
image_ns = cg.esphome_ns.namespace("image")
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ void LilygoT547Touchscreen::update_touches() {
|
||||
id = (buffer[i * 5] >> 4) & 0x0F;
|
||||
y_raw = (uint16_t) ((buffer[i * 5 + 1] << 4) | ((buffer[i * 5 + 3] >> 4) & 0x0F));
|
||||
x_raw = (uint16_t) ((buffer[i * 5 + 2] << 4) | (buffer[i * 5 + 3] & 0x0F));
|
||||
this->set_raw_touch_position_(id, x_raw, y_raw);
|
||||
this->add_raw_touch_position_(id, x_raw, y_raw);
|
||||
}
|
||||
|
||||
this->status_clear_warning();
|
||||
|
||||
@@ -172,7 +172,9 @@ CONFIG_SCHEMA = cv.All(
|
||||
esp8266=UART0,
|
||||
esp32=UART0,
|
||||
esp32_s2=USB_CDC,
|
||||
esp32_s3=USB_CDC,
|
||||
esp32_s3_idf=USB_SERIAL_JTAG,
|
||||
esp32_c3_idf=USB_SERIAL_JTAG,
|
||||
esp32_s3_arduino=USB_CDC,
|
||||
rp2040=USB_CDC,
|
||||
bk72xx=DEFAULT,
|
||||
rtl87xx=DEFAULT,
|
||||
|
||||
@@ -285,6 +285,7 @@ void Logger::pre_setup() {
|
||||
#if defined(USE_ESP32_VARIANT_ESP32S2) || defined(USE_ESP32_VARIANT_ESP32S3)
|
||||
#if ARDUINO_USB_CDC_ON_BOOT
|
||||
this->hw_serial_ = &Serial;
|
||||
Serial.setTxTimeoutMs(0); // workaround for 2.0.9 crash when there's no data connection
|
||||
Serial.begin(this->baud_rate_);
|
||||
#else
|
||||
this->hw_serial_ = &Serial;
|
||||
|
||||
@@ -51,7 +51,7 @@ void Touchscreen::loop() {
|
||||
}
|
||||
}
|
||||
|
||||
void Touchscreen::set_raw_touch_position_(uint8_t id, int16_t x_raw, int16_t y_raw, int16_t z_raw) {
|
||||
void Touchscreen::add_raw_touch_position_(uint8_t id, int16_t x_raw, int16_t y_raw, int16_t z_raw) {
|
||||
TouchPoint tp;
|
||||
uint16_t x, y;
|
||||
if (this->touches_.count(id) == 0) {
|
||||
|
||||
@@ -87,7 +87,7 @@ class Touchscreen : public PollingComponent {
|
||||
|
||||
void attach_interrupt_(InternalGPIOPin *irq_pin, esphome::gpio::InterruptType type);
|
||||
|
||||
void set_raw_touch_position_(uint8_t id, int16_t x_raw, int16_t y_raw, int16_t z_raw = 0);
|
||||
void add_raw_touch_position_(uint8_t id, int16_t x_raw, int16_t y_raw, int16_t z_raw = 0);
|
||||
|
||||
void send_touches_();
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ void TT21100Touchscreen::update_touches() {
|
||||
i, touch->touch_type, touch->tip, touch->event_id, touch->touch_id, touch->x, touch->y,
|
||||
touch->pressure, touch->major_axis_length, touch->orientation);
|
||||
|
||||
this->set_raw_touch_position_(touch->tip, touch->x, touch->y, touch->pressure);
|
||||
this->add_raw_touch_position_(touch->tip, touch->x, touch->y, touch->pressure);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ void XPT2046Component::update_touches() {
|
||||
|
||||
ESP_LOGV(TAG, "Touchscreen Update [%d, %d], z = %d", x_raw, y_raw, z_raw);
|
||||
|
||||
this->set_raw_touch_position_(0, x_raw, y_raw, z_raw);
|
||||
this->add_raw_touch_position_(0, x_raw, y_raw, z_raw);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,17 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def iter_components(config):
|
||||
for domain, conf in config.items():
|
||||
component = get_component(domain)
|
||||
yield domain, component
|
||||
if component.is_platform_component:
|
||||
for p_config in conf:
|
||||
p_name = f"{domain}.{p_config[CONF_PLATFORM]}"
|
||||
platform = get_platform(domain, p_config[CONF_PLATFORM])
|
||||
yield p_name, platform
|
||||
|
||||
|
||||
def iter_component_configs(config):
|
||||
for domain, conf in config.items():
|
||||
component = get_component(domain)
|
||||
if component.multi_conf:
|
||||
@@ -303,8 +314,10 @@ class LoadValidationStep(ConfigValidationStep):
|
||||
# Ignore top-level keys starting with a dot
|
||||
return
|
||||
result.add_output_path([self.domain], self.domain)
|
||||
result[self.domain] = self.conf
|
||||
component = get_component(self.domain)
|
||||
if component.multi_conf_no_default and isinstance(self.conf, core.AutoLoad):
|
||||
self.conf = []
|
||||
result[self.domain] = self.conf
|
||||
path = [self.domain]
|
||||
if component is None:
|
||||
result.add_str_error(f"Component not found: {self.domain}", path)
|
||||
@@ -424,7 +437,10 @@ class MetadataValidationStep(ConfigValidationStep):
|
||||
|
||||
def run(self, result: Config) -> None:
|
||||
if self.conf is None:
|
||||
result[self.domain] = self.conf = {}
|
||||
if self.comp.multi_conf and self.comp.multi_conf_no_default:
|
||||
result[self.domain] = self.conf = []
|
||||
else:
|
||||
result[self.domain] = self.conf = {}
|
||||
|
||||
success = True
|
||||
for dependency in self.comp.dependencies:
|
||||
|
||||
@@ -1541,6 +1541,9 @@ class SplitDefault(Optional):
|
||||
esp32_s3=vol.UNDEFINED,
|
||||
esp32_s3_arduino=vol.UNDEFINED,
|
||||
esp32_s3_idf=vol.UNDEFINED,
|
||||
esp32_c3=vol.UNDEFINED,
|
||||
esp32_c3_arduino=vol.UNDEFINED,
|
||||
esp32_c3_idf=vol.UNDEFINED,
|
||||
rp2040=vol.UNDEFINED,
|
||||
bk72xx=vol.UNDEFINED,
|
||||
rtl87xx=vol.UNDEFINED,
|
||||
@@ -1549,22 +1552,28 @@ class SplitDefault(Optional):
|
||||
super().__init__(key)
|
||||
self._esp8266_default = vol.default_factory(esp8266)
|
||||
self._esp32_arduino_default = vol.default_factory(
|
||||
_get_priority_default(esp32, esp32_arduino)
|
||||
_get_priority_default(esp32_arduino, esp32)
|
||||
)
|
||||
self._esp32_idf_default = vol.default_factory(
|
||||
_get_priority_default(esp32, esp32_idf)
|
||||
_get_priority_default(esp32_idf, esp32)
|
||||
)
|
||||
self._esp32_s2_arduino_default = vol.default_factory(
|
||||
_get_priority_default(esp32_s2, esp32, esp32_s2_arduino, esp32_arduino)
|
||||
_get_priority_default(esp32_s2_arduino, esp32_s2, esp32_arduino, esp32)
|
||||
)
|
||||
self._esp32_s2_idf_default = vol.default_factory(
|
||||
_get_priority_default(esp32_s2, esp32, esp32_s2_idf, esp32_idf)
|
||||
_get_priority_default(esp32_s2_idf, esp32_s2, esp32_idf, esp32)
|
||||
)
|
||||
self._esp32_s3_arduino_default = vol.default_factory(
|
||||
_get_priority_default(esp32_s3, esp32, esp32_s3_arduino, esp32_arduino)
|
||||
_get_priority_default(esp32_s3_arduino, esp32_s3, esp32_arduino, esp32)
|
||||
)
|
||||
self._esp32_s3_idf_default = vol.default_factory(
|
||||
_get_priority_default(esp32_s3, esp32, esp32_s3_idf, esp32_idf)
|
||||
_get_priority_default(esp32_s3_idf, esp32_s3, esp32_idf, esp32)
|
||||
)
|
||||
self._esp32_c3_arduino_default = vol.default_factory(
|
||||
_get_priority_default(esp32_c3_arduino, esp32_c3, esp32_arduino, esp32)
|
||||
)
|
||||
self._esp32_c3_idf_default = vol.default_factory(
|
||||
_get_priority_default(esp32_c3_idf, esp32_c3, esp32_idf, esp32)
|
||||
)
|
||||
self._rp2040_default = vol.default_factory(rp2040)
|
||||
self._bk72xx_default = vol.default_factory(bk72xx)
|
||||
@@ -1580,6 +1589,7 @@ class SplitDefault(Optional):
|
||||
from esphome.components.esp32.const import (
|
||||
VARIANT_ESP32S2,
|
||||
VARIANT_ESP32S3,
|
||||
VARIANT_ESP32C3,
|
||||
)
|
||||
|
||||
variant = get_esp32_variant()
|
||||
@@ -1593,6 +1603,11 @@ class SplitDefault(Optional):
|
||||
return self._esp32_s3_arduino_default
|
||||
if CORE.using_esp_idf:
|
||||
return self._esp32_s3_idf_default
|
||||
elif variant == VARIANT_ESP32C3:
|
||||
if CORE.using_arduino:
|
||||
return self._esp32_c3_arduino_default
|
||||
if CORE.using_esp_idf:
|
||||
return self._esp32_c3_idf_default
|
||||
else:
|
||||
if CORE.using_arduino:
|
||||
return self._esp32_arduino_default
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Constants used by esphome."""
|
||||
|
||||
__version__ = "2023.12.0b4"
|
||||
__version__ = "2023.12.2"
|
||||
|
||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||
VALID_SUBSTITUTIONS_CHARACTERS = (
|
||||
|
||||
@@ -792,13 +792,22 @@ class EditRequestHandler(BaseHandler):
|
||||
"""Get the content of a file."""
|
||||
loop = asyncio.get_running_loop()
|
||||
filename = settings.rel_path(configuration)
|
||||
content = await loop.run_in_executor(None, self._read_file, filename)
|
||||
self.write(content)
|
||||
content = await loop.run_in_executor(
|
||||
None, self._read_file, filename, configuration
|
||||
)
|
||||
if content is not None:
|
||||
self.write(content)
|
||||
|
||||
def _read_file(self, filename: str) -> bytes:
|
||||
def _read_file(self, filename: str, configuration: str) -> bytes | None:
|
||||
"""Read a file and return the content as bytes."""
|
||||
with open(file=filename, encoding="utf-8") as f:
|
||||
return f.read()
|
||||
try:
|
||||
with open(file=filename, encoding="utf-8") as f:
|
||||
return f.read()
|
||||
except FileNotFoundError:
|
||||
if configuration in const.SECRETS_FILES:
|
||||
return ""
|
||||
self.set_status(404)
|
||||
return None
|
||||
|
||||
def _write_file(self, filename: str, content: bytes) -> None:
|
||||
"""Write a file with the given content."""
|
||||
|
||||
@@ -357,7 +357,7 @@ def snake_case(value):
|
||||
return value.replace(" ", "_").lower()
|
||||
|
||||
|
||||
_DISALLOWED_CHARS = re.compile(r"[^a-zA-Z0-9_]")
|
||||
_DISALLOWED_CHARS = re.compile(r"[^a-zA-Z0-9-_]")
|
||||
|
||||
|
||||
def sanitize(value):
|
||||
|
||||
@@ -57,6 +57,10 @@ class ComponentManifest:
|
||||
def multi_conf(self) -> bool:
|
||||
return getattr(self.module, "MULTI_CONF", False)
|
||||
|
||||
@property
|
||||
def multi_conf_no_default(self) -> bool:
|
||||
return getattr(self.module, "MULTI_CONF_NO_DEFAULT", False)
|
||||
|
||||
@property
|
||||
def to_code(self) -> Optional[Callable[[Any], None]]:
|
||||
return getattr(self.module, "to_code", None)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import operator
|
||||
from functools import reduce
|
||||
import esphome.config_validation as cv
|
||||
from esphome.core import CORE, ID
|
||||
from esphome.core import CORE
|
||||
|
||||
from esphome.const import (
|
||||
CONF_INPUT,
|
||||
@@ -25,15 +25,16 @@ class PinRegistry(dict):
|
||||
def reset(self):
|
||||
self.pins_used = {}
|
||||
|
||||
def get_count(self, key, number):
|
||||
def get_count(self, key, id, number):
|
||||
"""
|
||||
Get the number of places a given pin is used.
|
||||
:param key: The ID of the defining component
|
||||
:param key: The key of the registered pin schema.
|
||||
:param id: The ID of the defining component
|
||||
:param number: The pin number
|
||||
:return: The number of places the pin is used.
|
||||
"""
|
||||
pin_key = (key, number)
|
||||
return self.pins_used[pin_key] if pin_key in self.pins_used else 0
|
||||
pin_key = (key, id, number)
|
||||
return len(self.pins_used[pin_key]) if pin_key in self.pins_used else 0
|
||||
|
||||
def register(self, name, schema, final_validate=None):
|
||||
"""
|
||||
@@ -65,9 +66,10 @@ class PinRegistry(dict):
|
||||
result = self[key][1](conf)
|
||||
if CONF_NUMBER in result:
|
||||
# key maps to the pin schema
|
||||
if isinstance(key, ID):
|
||||
key = key.id
|
||||
pin_key = (key, result[CONF_NUMBER])
|
||||
if key != CORE.target_platform:
|
||||
pin_key = (key, conf[key], result[CONF_NUMBER])
|
||||
else:
|
||||
pin_key = (key, key, result[CONF_NUMBER])
|
||||
if pin_key not in self.pins_used:
|
||||
self.pins_used[pin_key] = []
|
||||
# client_id identifies the instance of the providing component
|
||||
@@ -101,7 +103,7 @@ class PinRegistry(dict):
|
||||
Run the final validation for all pins, and check for reuse
|
||||
:param fconf: The full config
|
||||
"""
|
||||
for (key, _), pin_list in self.pins_used.items():
|
||||
for (key, _, _), pin_list in self.pins_used.items():
|
||||
count = len(pin_list) # number of places same pin used.
|
||||
final_val_fun = self[key][2] # final validation function
|
||||
for pin_path, client_id, pin_config in pin_list:
|
||||
|
||||
@@ -4,7 +4,7 @@ import re
|
||||
from pathlib import Path
|
||||
from typing import Union
|
||||
|
||||
from esphome.config import iter_components
|
||||
from esphome.config import iter_components, iter_component_configs
|
||||
from esphome.const import (
|
||||
HEADER_FILE_EXTENSIONS,
|
||||
SOURCE_FILE_EXTENSIONS,
|
||||
@@ -70,14 +70,14 @@ UPLOAD_SPEED_OVERRIDE = {
|
||||
|
||||
def get_flags(key):
|
||||
flags = set()
|
||||
for _, component, conf in iter_components(CORE.config):
|
||||
for _, component, conf in iter_component_configs(CORE.config):
|
||||
flags |= getattr(component, key)(conf)
|
||||
return flags
|
||||
|
||||
|
||||
def get_include_text():
|
||||
include_text = '#include "esphome.h"\nusing namespace esphome;\n'
|
||||
for _, component, conf in iter_components(CORE.config):
|
||||
for _, component, conf in iter_component_configs(CORE.config):
|
||||
if not hasattr(component, "includes"):
|
||||
continue
|
||||
includes = component.includes
|
||||
@@ -232,7 +232,7 @@ the custom_components folder or the external_components feature.
|
||||
|
||||
def copy_src_tree():
|
||||
source_files: list[loader.FileResource] = []
|
||||
for _, component, _ in iter_components(CORE.config):
|
||||
for _, component in iter_components(CORE.config):
|
||||
source_files += component.resources
|
||||
source_files_map = {
|
||||
Path(x.package.replace(".", "/") + "/" + x.resource): x for x in source_files
|
||||
|
||||
@@ -1667,7 +1667,6 @@ binary_sensor:
|
||||
mcp23xxx: mcp23s08_hub
|
||||
# Use pin number 1
|
||||
number: 1
|
||||
allow_other_uses: true
|
||||
# One of INPUT or INPUT_PULLUP
|
||||
mode: INPUT_PULLUP
|
||||
inverted: false
|
||||
@@ -2149,7 +2148,6 @@ output:
|
||||
pin:
|
||||
mcp23xxx: mcp23017_hub
|
||||
number: 0
|
||||
allow_other_uses: true
|
||||
mode: OUTPUT
|
||||
inverted: false
|
||||
- platform: gpio
|
||||
@@ -2157,7 +2155,6 @@ output:
|
||||
pin:
|
||||
mcp23xxx: mcp23008_hub
|
||||
number: 0
|
||||
allow_other_uses: true
|
||||
mode: OUTPUT
|
||||
inverted: false
|
||||
- platform: gpio
|
||||
@@ -2597,7 +2594,6 @@ switch:
|
||||
mcp23xxx: mcp23s08_hub
|
||||
# Use pin number 0
|
||||
number: 0
|
||||
allow_other_uses: true
|
||||
mode: OUTPUT
|
||||
inverted: false
|
||||
- platform: gpio
|
||||
|
||||
@@ -401,7 +401,6 @@ switch:
|
||||
pin:
|
||||
mcp23xxx: mcp23017_hub
|
||||
number: 0
|
||||
allow_other_uses: true
|
||||
mode: OUTPUT
|
||||
interlock: &interlock [gpio_switch1, gpio_switch2, gpio_switch3]
|
||||
- platform: gpio
|
||||
@@ -409,7 +408,6 @@ switch:
|
||||
pin:
|
||||
mcp23xxx: mcp23008_hub
|
||||
number: 0
|
||||
allow_other_uses: true
|
||||
mode: OUTPUT
|
||||
interlock: *interlock
|
||||
- platform: gpio
|
||||
|
||||
78
tests/test8.1.yaml
Normal file
78
tests/test8.1.yaml
Normal file
@@ -0,0 +1,78 @@
|
||||
# Tests for ESP32-S3 boards - IDf
|
||||
---
|
||||
wifi:
|
||||
ssid: "ssid"
|
||||
|
||||
network:
|
||||
enable_ipv6: true
|
||||
|
||||
esp32:
|
||||
board: esp32s3box
|
||||
variant: ESP32S3
|
||||
framework:
|
||||
type: esp-idf
|
||||
|
||||
esphome:
|
||||
name: esp32-s3-test
|
||||
|
||||
logger:
|
||||
|
||||
debug:
|
||||
|
||||
psram:
|
||||
|
||||
spi:
|
||||
- id: spi_id_1
|
||||
clk_pin:
|
||||
number: GPIO7
|
||||
allow_other_uses: false
|
||||
mosi_pin: GPIO6
|
||||
interface: any
|
||||
|
||||
spi_device:
|
||||
id: spidev
|
||||
data_rate: 2MHz
|
||||
spi_id: spi_id_1
|
||||
mode: 3
|
||||
bit_order: lsb_first
|
||||
|
||||
display:
|
||||
- platform: ili9xxx
|
||||
id: displ8
|
||||
model: ili9342
|
||||
cs_pin: GPIO5
|
||||
dc_pin: GPIO4
|
||||
reset_pin:
|
||||
number: GPIO48
|
||||
allow_other_uses: true
|
||||
|
||||
i2c:
|
||||
scl: GPIO18
|
||||
sda: GPIO8
|
||||
|
||||
touchscreen:
|
||||
- platform: tt21100
|
||||
display: displ8
|
||||
interrupt_pin:
|
||||
number: GPIO3
|
||||
ignore_strapping_warning: true
|
||||
allow_other_uses: false
|
||||
reset_pin:
|
||||
number: GPIO48
|
||||
allow_other_uses: true
|
||||
|
||||
binary_sensor:
|
||||
- platform: tt21100
|
||||
name: Home Button
|
||||
index: 1
|
||||
|
||||
sensor:
|
||||
- platform: debug
|
||||
free:
|
||||
name: "Heap Free"
|
||||
block:
|
||||
name: "Max Block Free"
|
||||
loop_time:
|
||||
name: "Loop Time"
|
||||
psram:
|
||||
name: "PSRAM Free"
|
||||
75
tests/test8.2.yaml
Normal file
75
tests/test8.2.yaml
Normal file
@@ -0,0 +1,75 @@
|
||||
# Tests for ESP32-C3 boards - IDf
|
||||
---
|
||||
wifi:
|
||||
ssid: "ssid"
|
||||
|
||||
network:
|
||||
enable_ipv6: true
|
||||
|
||||
esp32:
|
||||
board: lolin_c3_mini
|
||||
variant: ESP32C3
|
||||
framework:
|
||||
type: esp-idf
|
||||
|
||||
esphome:
|
||||
name: esp32-c3-test
|
||||
|
||||
logger:
|
||||
|
||||
debug:
|
||||
|
||||
psram:
|
||||
|
||||
spi:
|
||||
- id: spi_id_1
|
||||
clk_pin:
|
||||
number: GPIO7
|
||||
allow_other_uses: false
|
||||
mosi_pin: GPIO6
|
||||
interface: any
|
||||
|
||||
spi_device:
|
||||
id: spidev
|
||||
data_rate: 2MHz
|
||||
spi_id: spi_id_1
|
||||
mode: 3
|
||||
bit_order: lsb_first
|
||||
|
||||
display:
|
||||
- platform: ili9xxx
|
||||
id: displ8
|
||||
model: ili9342
|
||||
cs_pin: GPIO5
|
||||
dc_pin: GPIO4
|
||||
reset_pin:
|
||||
number: GPIO21
|
||||
|
||||
i2c:
|
||||
scl: GPIO18
|
||||
sda: GPIO8
|
||||
|
||||
touchscreen:
|
||||
- platform: tt21100
|
||||
display: displ8
|
||||
interrupt_pin:
|
||||
number: GPIO3
|
||||
allow_other_uses: false
|
||||
reset_pin:
|
||||
number: GPIO20
|
||||
|
||||
binary_sensor:
|
||||
- platform: tt21100
|
||||
name: Home Button
|
||||
index: 1
|
||||
|
||||
sensor:
|
||||
- platform: debug
|
||||
free:
|
||||
name: "Heap Free"
|
||||
block:
|
||||
name: "Max Block Free"
|
||||
loop_time:
|
||||
name: "Loop Time"
|
||||
psram:
|
||||
name: "PSRAM Free"
|
||||
@@ -92,3 +92,13 @@ sensor:
|
||||
name: "Loop Time"
|
||||
psram:
|
||||
name: "PSRAM Free"
|
||||
|
||||
# Purposely test that `animation:` does auto-load `image:`
|
||||
# Keep the `image:` undefined.
|
||||
# image:
|
||||
|
||||
animation:
|
||||
- id: rgb565_animation
|
||||
file: pnglogo.png
|
||||
type: RGB565
|
||||
use_transparency: no
|
||||
|
||||
@@ -261,6 +261,7 @@ def test_snake_case(text, expected):
|
||||
('!"§$%&/()=?foo_bar', "___________foo_bar"),
|
||||
('foo_!"§$%&/()=?bar', "foo____________bar"),
|
||||
('foo_bar!"§$%&/()=?', "foo_bar___________"),
|
||||
('foo-bar!"§$%&/()=?', "foo-bar___________"),
|
||||
),
|
||||
)
|
||||
def test_sanitize(text, expected):
|
||||
|
||||
Reference in New Issue
Block a user