diff --git a/esphome/cpp_generator.py b/esphome/cpp_generator.py index 2a0d0b217e..9a4cb2269a 100644 --- a/esphome/cpp_generator.py +++ b/esphome/cpp_generator.py @@ -712,7 +712,7 @@ async def templatable( value: Any, args: list[tuple[SafeExpType, str]], output_type: Optional[SafeExpType], - to_exp: Callable | dict = None, + to_exp: Union[Callable, dict] = None, ): """Generate code for a templatable config option.