[lvgl] Remap image to img in "set_style_*" (#7546)
Some checks are pending
CI / Run script/ci-custom (push) Blocked by required conditions
CI / list-components (push) Blocked by required conditions
CI / Create common environment (push) Waiting to run
CI / Check black (push) Blocked by required conditions
CI / Check flake8 (push) Blocked by required conditions
CI / Check pylint (push) Blocked by required conditions
CI / Check pyupgrade (push) Blocked by required conditions
CI / Run pytest (push) Blocked by required conditions
CI / Check clang-format (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 Arduino 1/4 (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 Arduino 2/4 (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 Arduino 3/4 (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 Arduino 4/4 (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 IDF (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP8266 (push) Blocked by required conditions
CI / Component test (push) Blocked by required conditions
CI / Split components for testing into 20 groups maximum (push) Blocked by required conditions
CI / Test split components (push) Blocked by required conditions
CI / CI Status (push) Blocked by required conditions
YAML lint / yamllint (push) Waiting to run

This commit is contained in:
guillempages 2024-10-06 00:44:18 +02:00 committed by GitHub
parent 0a62106b7b
commit b3cff566eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -12,7 +12,7 @@ from .defines import (
)
from .helpers import add_lv_use
from .lvcode import LambdaContext, LocalVariable, lv, lv_assign, lv_variable
from .schemas import ALL_STYLES
from .schemas import ALL_STYLES, STYLE_REMAP
from .types import lv_lambda_t, lv_obj_t, lv_obj_t_ptr
from .widgets import Widget, add_widgets, set_obj_properties, theme_widget_map
from .widgets.obj import obj_spec
@ -31,7 +31,8 @@ async def styles_to_code(config):
value = await validator.process(value)
if isinstance(value, list):
value = "|".join(value)
lv.call(f"style_set_{prop}", svar, literal(value))
remapped_prop = STYLE_REMAP.get(prop, prop)
lv.call(f"style_set_{remapped_prop}", svar, literal(value))
async def theme_to_code(config):

View file

@ -67,6 +67,9 @@ lvgl:
border_width: 2
pad_all: 4
align: center
- id: image_recolor
image_recolor: 0x10ca1e
image_recolor_opa: cover
touchscreens:
- touchscreen_id: tft_touch