mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-01 18:48:28 +02:00
Bump python min to 3.9 (#3871)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import logging
|
||||
from dataclasses import dataclass
|
||||
from typing import List
|
||||
|
||||
from esphome.const import (
|
||||
CONF_ID,
|
||||
@@ -200,7 +199,7 @@ async def esp8266_pin_to_code(config):
|
||||
@coroutine_with_priority(-999.0)
|
||||
async def add_pin_initial_states_array():
|
||||
# Add includes at the very end, so that they override everything
|
||||
initial_states: List[PinInitialState] = CORE.data[KEY_ESP8266][
|
||||
initial_states: list[PinInitialState] = CORE.data[KEY_ESP8266][
|
||||
KEY_PIN_INITIAL_STATES
|
||||
]
|
||||
initial_modes_s = ", ".join(str(x.mode) for x in initial_states)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, List
|
||||
from typing import Any
|
||||
import esphome.codegen as cg
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import (
|
||||
@@ -349,7 +349,7 @@ def _spi_extra_validate(config):
|
||||
class MethodDescriptor:
|
||||
method_schema: Any
|
||||
to_code: Any
|
||||
supported_chips: List[str]
|
||||
supported_chips: list[str]
|
||||
extra_validate: Any = None
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from typing import List
|
||||
import esphome.codegen as cg
|
||||
import esphome.config_validation as cv
|
||||
from esphome import automation
|
||||
@@ -60,7 +59,7 @@ SELECT_SCHEMA = cv.ENTITY_BASE_SCHEMA.extend(cv.MQTT_COMMAND_COMPONENT_SCHEMA).e
|
||||
)
|
||||
|
||||
|
||||
async def setup_select_core_(var, config, *, options: List[str]):
|
||||
async def setup_select_core_(var, config, *, options: list[str]):
|
||||
await setup_entity(var, config)
|
||||
|
||||
cg.add(var.traits.set_options(options))
|
||||
@@ -76,14 +75,14 @@ async def setup_select_core_(var, config, *, options: List[str]):
|
||||
await mqtt.register_mqtt_component(mqtt_, config)
|
||||
|
||||
|
||||
async def register_select(var, config, *, options: List[str]):
|
||||
async def register_select(var, config, *, options: list[str]):
|
||||
if not CORE.has_id(config[CONF_ID]):
|
||||
var = cg.Pvariable(config[CONF_ID], var)
|
||||
cg.add(cg.App.register_select(var))
|
||||
await setup_select_core_(var, config, options=options)
|
||||
|
||||
|
||||
async def new_select(config, *, options: List[str]):
|
||||
async def new_select(config, *, options: list[str]):
|
||||
var = cg.new_Pvariable(config[CONF_ID])
|
||||
await register_select(var, config, options=options)
|
||||
return var
|
||||
|
||||
Reference in New Issue
Block a user