Add the Elecrow CrowPanel 7.0" as a third board, and take the packages and the add-on from Gitea (0.2.93)
A board file for the Elecrow CrowPanel 7.0" (DIS08070H, ESP32-S3-WROOM-1-N4R8): 800x480 through mipi_rgb, GT911 on the ESP32-S3's USB pins (elecrow_usb_phy.h frees them, behind a flag only this board sets), the Guition's vertical sizes across a wider page, no rotation. Its 4 MB of flash take the CYD's budget: a partition table of the component's (smart_display: partitions: 4mb_wide_slots, 1,984 KB slots), the icon fonts at 2 bits a pixel and the TLS client only bring the firmware to 1,865,440 bytes, 91.8 % of a slot, with camera images kept. docs/ELECROW.md has the numbers and the trade. The add-on reads a large board's name from the type sensor's value, the editor offers the board under New screen and draws the wide preview, tools/check.sh builds it with the budget, render_topbar and capture_ui take the panel's size. Firmware 0.2.79; the CYD image is unchanged (1,633,760 bytes). This fork builds from gittea.trippedonmy.name/Xandrossian/homeassistant_espscreen: the packages, the fonts, the component and the add-on repository point there instead of GitHub.
This commit is contained in:
@@ -4,19 +4,26 @@
|
||||
screen_manager/translations/nl.json, with English for any key it lacks, becomes one table in main.cpp
|
||||
(screen_text_gen.py, screen_text.h). The shared core sets it from the LANGUAGE substitution, which ESP Screens writes
|
||||
into a screen's YAML.
|
||||
|
||||
`smart_display: partitions: 4mb_wide_slots` (firmware 0.2.79) builds with one of the partition tables of partitions.py
|
||||
instead of ESPHome's own: two update slots of 1,984 KB on a 4 MB ESP32-S3, which the Elecrow CrowPanel 7.0" needs.
|
||||
"""
|
||||
import logging
|
||||
|
||||
import esphome.codegen as cg
|
||||
from esphome.components import esp32
|
||||
import esphome.config_validation as cv
|
||||
from esphome.core import CORE
|
||||
from esphome.helpers import write_file_if_changed
|
||||
|
||||
from . import screen_text_gen
|
||||
from . import partitions, screen_text_gen
|
||||
|
||||
CODEOWNERS = []
|
||||
AUTO_LOAD = ["json"]
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
CONF_LANGUAGE = "language"
|
||||
CONF_PARTITIONS = "partitions"
|
||||
|
||||
|
||||
def _language(value):
|
||||
@@ -26,7 +33,10 @@ def _language(value):
|
||||
return value
|
||||
|
||||
|
||||
CONFIG_SCHEMA = cv.Schema({cv.Optional(CONF_LANGUAGE, default="en"): _language})
|
||||
CONFIG_SCHEMA = cv.Schema({
|
||||
cv.Optional(CONF_LANGUAGE, default="en"): _language,
|
||||
cv.Optional(CONF_PARTITIONS): cv.one_of(*partitions.TABLES, lower=True),
|
||||
})
|
||||
|
||||
|
||||
async def to_code(config):
|
||||
@@ -36,3 +46,8 @@ async def to_code(config):
|
||||
# ESP Screens only writes languages it has; a hand-written one it lacks builds in the nearest it does have.
|
||||
_LOGGER.warning("No translation for %s yet; the screen's texts are in %s", wanted, language)
|
||||
cg.add_global(cg.RawStatement(code))
|
||||
if CONF_PARTITIONS in config:
|
||||
# ESPHome writes no partitions.csv of its own when one is among the extra build files (esp32.copy_files).
|
||||
table = CORE.relative_build_path("smart_display_partitions.csv")
|
||||
write_file_if_changed(table, partitions.TABLES[config[CONF_PARTITIONS]])
|
||||
esp32.add_extra_build_file("partitions.csv", table)
|
||||
|
||||
Reference in New Issue
Block a user