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

[lvgl] Fix race condition involving numbers, switches etc. (#7345)

This commit is contained in:
Clyde Stubbs
2024-08-26 08:03:25 +10:00
committed by GitHub
parent caaae59ea9
commit 71d6bbc7e6
11 changed files with 33 additions and 12 deletions

View File

@@ -176,6 +176,8 @@ class LvContext(LambdaContext):
Code generation into the LVGL initialisation code (called in `setup()`)
"""
added_lambda_count = 0
def __init__(self, lv_component, args=None):
self.args = args or LVGL_COMP_ARG
super().__init__(parameters=self.args)
@@ -183,6 +185,7 @@ class LvContext(LambdaContext):
async def add_init_lambda(self):
cg.add(self.lv_component.add_init_lambda(await self.get_lambda()))
LvContext.added_lambda_count += 1
async def __aexit__(self, exc_type, exc_val, exc_tb):
await super().__aexit__(exc_type, exc_val, exc_tb)