[lvgl] Migrate to library v9.5.0 (#12312)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
This commit is contained in:
54 files changed
+2312
-1197
No files matched your search
@@ -168,6 +168,9 @@ class LambdaContext(CodeContext):
|
||||
def get_automation_parameters(self) -> list[tuple[SafeExpType, str]]:
|
||||
return self.parameters
|
||||
|
||||
def get_parameter(self, index: int):
|
||||
return literal(self.parameters[index][1])
|
||||
|
||||
async def __aenter__(self):
|
||||
await super().__aenter__()
|
||||
add_line_marks(self.where)
|
||||
@@ -250,10 +253,14 @@ class MockLv:
|
||||
A mock object that can be used to generate LVGL calls.
|
||||
"""
|
||||
|
||||
# Mapping for LVGL 9
|
||||
ATTR_MAP = {"event_send": "obj_send_event", "dither": "bg_dither_mode"}
|
||||
|
||||
def __init__(self, base):
|
||||
self.base = base
|
||||
|
||||
def __getattr__(self, attr: str) -> "MockLv":
|
||||
attr = MockLv.ATTR_MAP.get(attr, attr)
|
||||
return MockLv(f"{self.base}{attr}")
|
||||
|
||||
def append(self, expression):
|
||||
@@ -307,6 +314,7 @@ class ReturnStatement(ExpressionStatement):
|
||||
|
||||
class LvExpr(MockLv):
|
||||
def __getattr__(self, attr: str) -> "MockLv":
|
||||
attr = MockLv.ATTR_MAP.get(attr, attr)
|
||||
return LvExpr(f"{self.base}{attr}")
|
||||
|
||||
def append(self, expression):
|
||||
|
||||
Reference in new issue
Block a user