mirror of
https://github.com/esphome/esphome.git
synced 2026-05-22 01:42:49 +08:00
[st7789v] Add deprecation warnings (#16162)
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
import esphome.codegen as cg
|
||||
|
||||
st7789v_ns = cg.esphome_ns.namespace("st7789v")
|
||||
|
||||
DEPRECATED_COMPONENT = """
|
||||
The 'st7789v' component is deprecated and no new functionality will be added to it.
|
||||
PRs should target the newer and more performant 'mipi_spi' component.
|
||||
"""
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import logging
|
||||
|
||||
from esphome import pins
|
||||
import esphome.codegen as cg
|
||||
from esphome.components import display, power_supply, spi
|
||||
@@ -26,6 +28,8 @@ CODEOWNERS = ["@kbx81"]
|
||||
|
||||
DEPENDENCIES = ["spi"]
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
ST7789V = st7789v_ns.class_(
|
||||
"ST7789V", cg.PollingComponent, spi.SPIDevice, display.DisplayBuffer
|
||||
)
|
||||
@@ -175,6 +179,9 @@ FINAL_VALIDATE_SCHEMA = spi.final_validate_device_schema(
|
||||
|
||||
|
||||
async def to_code(config):
|
||||
LOGGER.warning(
|
||||
"The 'st7789v' component is deprecated, it is recommended to use 'mipi_spi' instead."
|
||||
)
|
||||
var = cg.new_Pvariable(config[CONF_ID])
|
||||
await display.register_display(var, config)
|
||||
await spi.register_spi_device(var, config, write_only=True)
|
||||
|
||||
Reference in New Issue
Block a user