mirror of
https://github.com/esphome/esphome.git
synced 2026-08-22 22:26:21 +00:00
[mipi_dsi] New model for M5Stack Tab5 (#17500)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
e6525b5d93
commit
54529412dc
@@ -1,6 +1,7 @@
|
||||
"""Tests for mpi_dsi configuration validation."""
|
||||
|
||||
from collections.abc import Callable
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
@@ -128,6 +129,32 @@ def test_configuration_success(set_core_config: SetCoreConfigCallable) -> None:
|
||||
CONFIG_SCHEMA(config)
|
||||
|
||||
|
||||
def test_deprecated_model_warning(
|
||||
set_core_config: SetCoreConfigCallable,
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
) -> None:
|
||||
"""The deprecated M5Stack-Tab5-v2 alias warns and points at the replacement models."""
|
||||
set_core_config(
|
||||
PlatformFramework.ESP32_IDF,
|
||||
platform_data={KEY_BOARD: "esp32-p4-evboard", KEY_VARIANT: VARIANT_ESP32P4},
|
||||
)
|
||||
|
||||
from esphome.components.mipi_dsi.display import CONFIG_SCHEMA
|
||||
|
||||
with caplog.at_level(logging.WARNING):
|
||||
CONFIG_SCHEMA({"id": "deprecated_display", "model": "M5Stack-Tab5-v2"})
|
||||
assert "M5STACK-TAB5-V2 is deprecated" in caplog.text
|
||||
# The warning names the replacement models so users know what to switch to.
|
||||
assert "M5STACK-TAB5-ST7123" in caplog.text
|
||||
|
||||
# The replacement models validate without emitting a deprecation warning.
|
||||
caplog.clear()
|
||||
with caplog.at_level(logging.WARNING):
|
||||
CONFIG_SCHEMA({"id": "st7123_display", "model": "M5Stack-Tab5-ST7123"})
|
||||
CONFIG_SCHEMA({"id": "st7121_display", "model": "M5Stack-Tab5-ST7121"})
|
||||
assert "deprecated" not in caplog.text
|
||||
|
||||
|
||||
def test_metadata_records_rotation(set_core_config: SetCoreConfigCallable) -> None:
|
||||
"""A configured display rotation is recorded in the metadata.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user