From 6a6aee510d3bedbc2407dfd7870be4865a613bdc Mon Sep 17 00:00:00 2001 From: NP v/d Spek Date: Mon, 13 Mar 2023 01:13:19 +0100 Subject: [PATCH] On the ILI9xxx display's enable the psram on esp32 and allow big screen (#4551) * enable the psram on esp32 and allow big screen * update CODEOWNERS * small update * update CODEOWNERS again. * Removed the M5STACK because it is a ESP32 device. * i removed the wrong model * update the error message. --- esphome/components/ili9xxx/display.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/esphome/components/ili9xxx/display.py b/esphome/components/ili9xxx/display.py index 437fc93b89..780c64ec70 100644 --- a/esphome/components/ili9xxx/display.py +++ b/esphome/components/ili9xxx/display.py @@ -16,7 +16,13 @@ from esphome.const import ( ) DEPENDENCIES = ["spi"] -AUTO_LOAD = ["psram"] + + +def AUTO_LOAD(): + if CORE.is_esp32: + return ["psram"] + return [] + CODEOWNERS = ["@nielsnl68"] @@ -60,6 +66,16 @@ def _validate(config): raise cv.Invalid( "Providing color palette images requires palette mode to be 'IMAGE_ADAPTIVE'" ) + if CORE.is_esp8266 and config.get(CONF_MODEL) not in [ + "M5STACK", + "TFT_2.4", + "TFT_2.4R", + "ILI9341", + "ILI9342", + ]: + raise cv.Invalid( + "Provided model can't run on ESP8266. Use an ESP32 with PSRAM onboard" + ) return config