1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-05 19:33:47 +01:00

[lvgl] Allow multiple LVGL instances (#7712)

Co-authored-by: clydeps <U5yx99dok9>
This commit is contained in:
Clyde Stubbs
2024-11-08 07:05:23 +11:00
committed by GitHub
parent 80b4c26481
commit 248b0bc378
17 changed files with 287 additions and 226 deletions

View File

@@ -178,10 +178,9 @@ class LvContext(LambdaContext):
added_lambda_count = 0
def __init__(self, lv_component, args=None):
def __init__(self, args=None):
self.args = args or LVGL_COMP_ARG
super().__init__(parameters=self.args)
self.lv_component = lv_component
async def __aexit__(self, exc_type, exc_val, exc_tb):
await super().__aexit__(exc_type, exc_val, exc_tb)
@@ -298,6 +297,7 @@ lv_expr = LvExpr("lv_")
lv_obj = MockLv("lv_obj_")
# Operations on the LVGL component
lvgl_comp = MockObj(LVGL_COMP, "->")
lvgl_static = MockObj("LvglComponent", "::")
# equivalent to cg.add() for the current code context