1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-06 05:12:21 +01:00

update minimal python version to 3.10 (#8850)

This commit is contained in:
Thomas Rupprecht
2025-05-22 03:21:43 +02:00
committed by GitHub
parent 026f47bfb3
commit aeb4e63950
36 changed files with 148 additions and 166 deletions

View File

@@ -1,5 +1,3 @@
from typing import Union
import esphome.codegen as cg
from esphome.components import image
from esphome.components.color import CONF_HEX, ColorStruct, from_rgbw
@@ -361,7 +359,7 @@ lv_image_list = LValidator(
lv_bool = LValidator(cv.boolean, cg.bool_, retmapper=literal)
def lv_pct(value: Union[int, float]):
def lv_pct(value: int | float):
if isinstance(value, float):
value = int(value * 100)
return literal(f"lv_pct({value})")