[ruff] Apply various ruff suggestions (#8947)

This commit is contained in:
Jesse Hills 2025-06-16 15:13:14 +12:00 committed by GitHub
parent 882bfc79c7
commit c4f7c2d259
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 14 additions and 12 deletions

View File

@ -1,4 +1,5 @@
import re
from esphome import automation
import esphome.codegen as cg
import esphome.config_validation as cv

View File

@ -1,10 +1,10 @@
"""CM1106 Sensor component for ESPHome."""
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import automation
from esphome.automation import maybe_simple_id
import esphome.codegen as cg
from esphome.components import sensor, uart
import esphome.config_validation as cv
from esphome.const import (
CONF_CO2,
CONF_ID,

View File

@ -1,6 +1,6 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import i2c
import esphome.config_validation as cv
from esphome.const import CONF_ID
CODEOWNERS = ["@p1ngb4ck"]

View File

@ -1,8 +1,9 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import output
import esphome.config_validation as cv
from esphome.const import CONF_CHANNEL, CONF_ID, CONF_INITIAL_VALUE
from .. import Mcp4461Component, CONF_MCP4461_ID, mcp4461_ns
from .. import CONF_MCP4461_ID, Mcp4461Component, mcp4461_ns
DEPENDENCIES = ["mcp4461"]

View File

@ -3,6 +3,8 @@ import esphome.codegen as cg
from esphome.components import i2c, sensirion_common, sensor
import esphome.config_validation as cv
from esphome.const import (
CONF_AMBIENT_PRESSURE_COMPENSATION,
CONF_AUTOMATIC_SELF_CALIBRATION,
CONF_CO2,
CONF_HUMIDITY,
CONF_ID,
@ -18,8 +20,6 @@ from esphome.const import (
UNIT_CELSIUS,
UNIT_PARTS_PER_MILLION,
UNIT_PERCENT,
CONF_AUTOMATIC_SELF_CALIBRATION,
CONF_AMBIENT_PRESSURE_COMPENSATION,
)
DEPENDENCIES = ["i2c"]

View File

@ -4,9 +4,13 @@ import esphome.codegen as cg
from esphome.components import i2c, sensirion_common, sensor
import esphome.config_validation as cv
from esphome.const import (
CONF_AMBIENT_PRESSURE_COMPENSATION,
CONF_AMBIENT_PRESSURE_COMPENSATION_SOURCE,
CONF_AUTOMATIC_SELF_CALIBRATION,
CONF_CO2,
CONF_HUMIDITY,
CONF_ID,
CONF_MEASUREMENT_MODE,
CONF_TEMPERATURE,
CONF_TEMPERATURE_OFFSET,
CONF_VALUE,
@ -20,10 +24,6 @@ from esphome.const import (
UNIT_CELSIUS,
UNIT_PARTS_PER_MILLION,
UNIT_PERCENT,
CONF_AUTOMATIC_SELF_CALIBRATION,
CONF_AMBIENT_PRESSURE_COMPENSATION,
CONF_AMBIENT_PRESSURE_COMPENSATION_SOURCE,
CONF_MEASUREMENT_MODE,
)
CODEOWNERS = ["@sjtrny", "@martgras"]

View File

@ -2,10 +2,10 @@ import esphome.codegen as cg
from esphome.components import i2c, sensirion_common, sensor
import esphome.config_validation as cv
from esphome.const import (
CONF_MEASUREMENT_MODE,
DEVICE_CLASS_PRESSURE,
STATE_CLASS_MEASUREMENT,
UNIT_HECTOPASCAL,
CONF_MEASUREMENT_MODE,
)
DEPENDENCIES = ["i2c"]