From 6c50ca76efb6177a795f7dc494c8ec4bed674581 Mon Sep 17 00:00:00 2001 From: clydebarrow <2366188+clydebarrow@users.noreply.github.com> Date: Mon, 13 May 2024 11:19:30 +1000 Subject: [PATCH] Prefer Union to Optional --- esphome/cpp_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/cpp_generator.py b/esphome/cpp_generator.py index e2dbbf3d43..2a0d0b217e 100644 --- a/esphome/cpp_generator.py +++ b/esphome/cpp_generator.py @@ -654,7 +654,7 @@ async def process_lambda( parameters: list[tuple[SafeExpType, str]], capture: str = "=", return_type: SafeExpType = None, -) -> Optional[LambdaExpression]: +) -> Union[LambdaExpression, None]: """Process the given lambda value into a LambdaExpression. This is a coroutine because lambdas can depend on other IDs,