1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-29 22:24:26 +00:00

Bump ruff from 0.9.2 to 0.11.0 (#8409)

This commit is contained in:
dependabot[bot]
2025-03-20 09:51:23 -10:00
committed by GitHub
parent 6ea89644e7
commit 4adda632bb
651 changed files with 1962 additions and 2270 deletions

View File

@@ -1,15 +1,8 @@
import esphome.codegen as cg
from esphome.components import alarm_control_panel, binary_sensor
import esphome.config_validation as cv
from esphome.components import (
binary_sensor,
alarm_control_panel,
)
from esphome.const import (
CONF_ID,
CONF_BINARY_SENSORS,
CONF_INPUT,
CONF_RESTORE_MODE,
)
from esphome.const import CONF_BINARY_SENSORS, CONF_ID, CONF_INPUT, CONF_RESTORE_MODE
from .. import template_ns
CODEOWNERS = ["@grahambrown11", "@hwstar"]

View File

@@ -1,7 +1,7 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import automation
import esphome.codegen as cg
from esphome.components import cover
import esphome.config_validation as cv
from esphome.const import (
CONF_ASSUMED_STATE,
CONF_CLOSE_ACTION,
@@ -11,14 +11,15 @@ from esphome.const import (
CONF_OPEN_ACTION,
CONF_OPTIMISTIC,
CONF_POSITION,
CONF_POSITION_ACTION,
CONF_RESTORE_MODE,
CONF_STATE,
CONF_STOP_ACTION,
CONF_TILT,
CONF_TILT_ACTION,
CONF_TILT_LAMBDA,
CONF_POSITION_ACTION,
)
from .. import template_ns
TemplateCover = template_ns.class_("TemplateCover", cover.Cover, cg.Component)

View File

@@ -1,18 +1,18 @@
from esphome import automation
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import datetime
import esphome.config_validation as cv
from esphome.const import (
CONF_INITIAL_VALUE,
CONF_LAMBDA,
CONF_OPTIMISTIC,
CONF_RESTORE_VALUE,
CONF_SET_ACTION,
CONF_DAY,
CONF_HOUR,
CONF_INITIAL_VALUE,
CONF_LAMBDA,
CONF_MINUTE,
CONF_MONTH,
CONF_OPTIMISTIC,
CONF_RESTORE_VALUE,
CONF_SECOND,
CONF_SET_ACTION,
CONF_TYPE,
CONF_YEAR,
)
@@ -44,9 +44,8 @@ def validate(config):
raise cv.Invalid("initial_value cannot be used with lambda")
if CONF_RESTORE_VALUE in config:
raise cv.Invalid("restore_value cannot be used with lambda")
else:
if CONF_RESTORE_VALUE not in config:
config[CONF_RESTORE_VALUE] = False
elif CONF_RESTORE_VALUE not in config:
config[CONF_RESTORE_VALUE] = False
if not config[CONF_OPTIMISTIC] and CONF_SET_ACTION not in config:
raise cv.Invalid(

View File

@@ -1,9 +1,6 @@
import esphome.config_validation as cv
from esphome.components import event
import esphome.codegen as cg
from esphome.components import event
import esphome.config_validation as cv
from esphome.const import CONF_EVENT_TYPES
from .. import template_ns

View File

@@ -1,12 +1,8 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import fan
from esphome.components.fan import validate_preset_modes
from esphome.const import (
CONF_OUTPUT_ID,
CONF_PRESET_MODES,
CONF_SPEED_COUNT,
)
import esphome.config_validation as cv
from esphome.const import CONF_OUTPUT_ID, CONF_PRESET_MODES, CONF_SPEED_COUNT
from .. import template_ns

View File

@@ -1,7 +1,7 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import automation
import esphome.codegen as cg
from esphome.components import lock
import esphome.config_validation as cv
from esphome.const import (
CONF_ASSUMED_STATE,
CONF_ID,
@@ -12,6 +12,7 @@ from esphome.const import (
CONF_STATE,
CONF_UNLOCK_ACTION,
)
from .. import template_ns
TemplateLock = template_ns.class_("TemplateLock", lock.Lock, cg.Component)

View File

@@ -1,7 +1,7 @@
from esphome import automation
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import number
import esphome.config_validation as cv
from esphome.const import (
CONF_ID,
CONF_INITIAL_VALUE,
@@ -10,9 +10,10 @@ from esphome.const import (
CONF_MIN_VALUE,
CONF_OPTIMISTIC,
CONF_RESTORE_VALUE,
CONF_STEP,
CONF_SET_ACTION,
CONF_STEP,
)
from .. import template_ns
TemplateNumber = template_ns.class_(

View File

@@ -1,8 +1,9 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import automation
import esphome.codegen as cg
from esphome.components import output
from esphome.const import CONF_ID, CONF_TYPE, CONF_BINARY
import esphome.config_validation as cv
from esphome.const import CONF_BINARY, CONF_ID, CONF_TYPE
from .. import template_ns
TemplateBinaryOutput = template_ns.class_("TemplateBinaryOutput", output.BinaryOutput)

View File

@@ -1,16 +1,17 @@
from esphome import automation
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import select
import esphome.config_validation as cv
from esphome.const import (
CONF_ID,
CONF_INITIAL_OPTION,
CONF_LAMBDA,
CONF_OPTIONS,
CONF_OPTIMISTIC,
CONF_OPTIONS,
CONF_RESTORE_VALUE,
CONF_SET_ACTION,
)
from .. import template_ns
TemplateSelect = template_ns.class_(

View File

@@ -1,12 +1,9 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import automation
import esphome.codegen as cg
from esphome.components import sensor
from esphome.const import (
CONF_ID,
CONF_LAMBDA,
CONF_STATE,
)
import esphome.config_validation as cv
from esphome.const import CONF_ID, CONF_LAMBDA, CONF_STATE
from .. import template_ns
TemplateSensor = template_ns.class_(

View File

@@ -1,7 +1,7 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import automation
import esphome.codegen as cg
from esphome.components import switch
import esphome.config_validation as cv
from esphome.const import (
CONF_ASSUMED_STATE,
CONF_ID,
@@ -12,6 +12,7 @@ from esphome.const import (
CONF_TURN_OFF_ACTION,
CONF_TURN_ON_ACTION,
)
from .. import template_ns
TemplateSwitch = template_ns.class_("TemplateSwitch", switch.Switch, cg.Component)

View File

@@ -1,17 +1,18 @@
from esphome import automation
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import text
import esphome.config_validation as cv
from esphome.const import (
CONF_INITIAL_VALUE,
CONF_LAMBDA,
CONF_OPTIMISTIC,
CONF_RESTORE_VALUE,
CONF_MAX_LENGTH,
CONF_MIN_LENGTH,
CONF_OPTIMISTIC,
CONF_PATTERN,
CONF_RESTORE_VALUE,
CONF_SET_ACTION,
)
from .. import template_ns
TemplateText = template_ns.class_("TemplateText", text.Text, cg.PollingComponent)

View File

@@ -1,9 +1,10 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import automation
import esphome.codegen as cg
from esphome.components import text_sensor
from esphome.components.text_sensor import TextSensorPublishAction
import esphome.config_validation as cv
from esphome.const import CONF_ID, CONF_LAMBDA, CONF_STATE
from .. import template_ns
TemplateTextSensor = template_ns.class_(

View File

@@ -1,7 +1,7 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import automation
import esphome.codegen as cg
from esphome.components import valve
import esphome.config_validation as cv
from esphome.const import (
CONF_ASSUMED_STATE,
CONF_CLOSE_ACTION,
@@ -16,6 +16,7 @@ from esphome.const import (
CONF_STATE,
CONF_STOP_ACTION,
)
from .. import template_ns
TemplateValve = template_ns.class_("TemplateValve", valve.Valve, cg.Component)