[thermostat] Fix linting and formatting issues (#7442)
Some checks failed
CI / Create common environment (push) Has been cancelled
CI / Run script/ci-custom (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 2/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 3/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 4/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 IDF (push) Has been cancelled
CI / Run script/clang-tidy for ESP8266 (push) Has been cancelled
CI / list-components (push) Has been cancelled
CI / Component test (push) Has been cancelled
CI / Split components for testing into 20 groups maximum (push) Has been cancelled
CI / Test split components (push) Has been cancelled
CI / CI Status (push) Has been cancelled
CI / Check black (push) Has been cancelled
CI / Check flake8 (push) Has been cancelled
CI / Check pylint (push) Has been cancelled
CI / Check pyupgrade (push) Has been cancelled
CI / Run pytest (push) Has been cancelled
CI / Check clang-format (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 1/4 (push) Has been cancelled

This commit is contained in:
Jesse Hills 2024-09-13 22:03:25 +12:00 committed by GitHub
parent c702a3f3ee
commit cf4bfcdce8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,7 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import automation from esphome import automation
import esphome.codegen as cg
from esphome.components import climate, sensor from esphome.components import climate, sensor
import esphome.config_validation as cv
from esphome.const import ( from esphome.const import (
CONF_AUTO_MODE, CONF_AUTO_MODE,
CONF_AWAY_CONFIG, CONF_AWAY_CONFIG,
@ -15,15 +15,15 @@ from esphome.const import (
CONF_DRY_ACTION, CONF_DRY_ACTION,
CONF_DRY_MODE, CONF_DRY_MODE,
CONF_FAN_MODE, CONF_FAN_MODE,
CONF_FAN_MODE_ON_ACTION,
CONF_FAN_MODE_OFF_ACTION,
CONF_FAN_MODE_AUTO_ACTION, CONF_FAN_MODE_AUTO_ACTION,
CONF_FAN_MODE_DIFFUSE_ACTION,
CONF_FAN_MODE_FOCUS_ACTION,
CONF_FAN_MODE_HIGH_ACTION,
CONF_FAN_MODE_LOW_ACTION, CONF_FAN_MODE_LOW_ACTION,
CONF_FAN_MODE_MEDIUM_ACTION, CONF_FAN_MODE_MEDIUM_ACTION,
CONF_FAN_MODE_HIGH_ACTION,
CONF_FAN_MODE_MIDDLE_ACTION, CONF_FAN_MODE_MIDDLE_ACTION,
CONF_FAN_MODE_FOCUS_ACTION, CONF_FAN_MODE_OFF_ACTION,
CONF_FAN_MODE_DIFFUSE_ACTION, CONF_FAN_MODE_ON_ACTION,
CONF_FAN_MODE_QUIET_ACTION, CONF_FAN_MODE_QUIET_ACTION,
CONF_FAN_ONLY_ACTION, CONF_FAN_ONLY_ACTION,
CONF_FAN_ONLY_ACTION_USES_FAN_MODE_TIMER, CONF_FAN_ONLY_ACTION_USES_FAN_MODE_TIMER,
@ -50,8 +50,8 @@ from esphome.const import (
CONF_MIN_HEATING_RUN_TIME, CONF_MIN_HEATING_RUN_TIME,
CONF_MIN_IDLE_TIME, CONF_MIN_IDLE_TIME,
CONF_MIN_TEMPERATURE, CONF_MIN_TEMPERATURE,
CONF_NAME,
CONF_MODE, CONF_MODE,
CONF_NAME,
CONF_OFF_MODE, CONF_OFF_MODE,
CONF_PRESET, CONF_PRESET,
CONF_SENSOR, CONF_SENSOR,
@ -892,7 +892,7 @@ async def to_code(config):
if name.upper() in climate.CLIMATE_PRESETS: if name.upper() in climate.CLIMATE_PRESETS:
standard_preset = climate.CLIMATE_PRESETS[name.upper()] standard_preset = climate.CLIMATE_PRESETS[name.upper()]
if two_points_available is True: if two_points_available:
preset_target_config = ThermostatClimateTargetTempConfig( preset_target_config = ThermostatClimateTargetTempConfig(
preset_config[CONF_DEFAULT_TARGET_TEMPERATURE_LOW], preset_config[CONF_DEFAULT_TARGET_TEMPERATURE_LOW],
preset_config[CONF_DEFAULT_TARGET_TEMPERATURE_HIGH], preset_config[CONF_DEFAULT_TARGET_TEMPERATURE_HIGH],
@ -905,6 +905,8 @@ async def to_code(config):
preset_target_config = ThermostatClimateTargetTempConfig( preset_target_config = ThermostatClimateTargetTempConfig(
preset_config[CONF_DEFAULT_TARGET_TEMPERATURE_LOW] preset_config[CONF_DEFAULT_TARGET_TEMPERATURE_LOW]
) )
else:
preset_target_config = None
preset_target_variable = cg.new_variable( preset_target_variable = cg.new_variable(
preset_config[CONF_ID], preset_target_config preset_config[CONF_ID], preset_target_config