[inkplate6] Require 240mhz cpu frequency (#9356)

This commit is contained in:
Jesse Hills 2025-07-07 16:36:34 +12:00 committed by GitHub
parent 2510b5ffb5
commit fde5f88192
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View File

@ -1,6 +1,7 @@
from esphome import pins
import esphome.codegen as cg
from esphome.components import display, i2c
from esphome.components.esp32 import CONF_CPU_FREQUENCY
import esphome.config_validation as cv
from esphome.const import (
CONF_FULL_UPDATE_EVERY,
@ -13,7 +14,9 @@ from esphome.const import (
CONF_PAGES,
CONF_TRANSFORM,
CONF_WAKEUP_PIN,
PLATFORM_ESP32,
)
import esphome.final_validate as fv
DEPENDENCIES = ["i2c", "esp32"]
AUTO_LOAD = ["psram"]
@ -120,6 +123,18 @@ CONFIG_SCHEMA = cv.All(
)
def _validate_cpu_frequency(config):
esp32_config = fv.full_config.get()[PLATFORM_ESP32]
if esp32_config[CONF_CPU_FREQUENCY] != "240MHZ":
raise cv.Invalid(
"Inkplate requires 240MHz CPU frequency (set in esp32 component)"
)
return config
FINAL_VALIDATE_SCHEMA = _validate_cpu_frequency
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])

View File

@ -3,6 +3,9 @@ i2c:
scl: 16
sda: 17
esp32:
cpu_frequency: 240MHz
display:
- platform: inkplate6
id: inkplate_display