From b7ab00b6994f1feae81df88a42e20e29c0737d29 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Feb 2023 07:40:04 +1300 Subject: [PATCH] Bump black from 22.12.0 to 23.1.0 (#4375) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- esphome/components/b_parasite/sensor.py | 2 +- esphome/components/esp8266/__init__.py | 1 - esphome/components/honeywellabp/sensor.py | 1 - esphome/components/nextion/base_component.py | 1 - esphome/components/nextion/sensor/__init__.py | 1 - esphome/components/pmsa003i/sensor.py | 1 - esphome/components/script/__init__.py | 1 - esphome/components/sht4x/sensor.py | 1 - esphome/dashboard/dashboard.py | 1 - requirements_test.txt | 2 +- 11 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7a954af4a6..0de82cf2de 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/ambv/black - rev: 22.12.0 + rev: 23.1.0 hooks: - id: black args: diff --git a/esphome/components/b_parasite/sensor.py b/esphome/components/b_parasite/sensor.py index 201685adc4..1b65bf7f1d 100644 --- a/esphome/components/b_parasite/sensor.py +++ b/esphome/components/b_parasite/sensor.py @@ -80,7 +80,7 @@ async def to_code(config): cg.add(var.set_address(config[CONF_MAC_ADDRESS].as_hex)) - for (config_key, setter) in [ + for config_key, setter in [ (CONF_TEMPERATURE, var.set_temperature), (CONF_HUMIDITY, var.set_humidity), (CONF_BATTERY_VOLTAGE, var.set_battery_voltage), diff --git a/esphome/components/esp8266/__init__.py b/esphome/components/esp8266/__init__.py index 8715a3b4e6..59a1f2cd85 100644 --- a/esphome/components/esp8266/__init__.py +++ b/esphome/components/esp8266/__init__.py @@ -240,7 +240,6 @@ async def to_code(config): # Called by writer.py def copy_files(): - dir = os.path.dirname(__file__) post_build_file = os.path.join(dir, "post_build.py.script") copy_file_if_changed( diff --git a/esphome/components/honeywellabp/sensor.py b/esphome/components/honeywellabp/sensor.py index 720a96b93c..ed8bff6e9b 100644 --- a/esphome/components/honeywellabp/sensor.py +++ b/esphome/components/honeywellabp/sensor.py @@ -52,7 +52,6 @@ CONFIG_SCHEMA = ( async def to_code(config): - var = cg.new_Pvariable(config[CONF_ID]) await cg.register_component(var, config) await spi.register_spi_device(var, config) diff --git a/esphome/components/nextion/base_component.py b/esphome/components/nextion/base_component.py index 06216e9ce0..b2a857c888 100644 --- a/esphome/components/nextion/base_component.py +++ b/esphome/components/nextion/base_component.py @@ -92,7 +92,6 @@ CONFIG_SWITCH_COMPONENT_SCHEMA = CONFIG_SENSOR_COMPONENT_SCHEMA.extend( async def setup_component_core_(var, config, arg): - if CONF_VARIABLE_NAME in config: cg.add(var.set_variable_name(config[CONF_VARIABLE_NAME])) elif CONF_COMPONENT_NAME in config: diff --git a/esphome/components/nextion/sensor/__init__.py b/esphome/components/nextion/sensor/__init__.py index b022007ddd..eefbe34d58 100644 --- a/esphome/components/nextion/sensor/__init__.py +++ b/esphome/components/nextion/sensor/__init__.py @@ -69,7 +69,6 @@ CONFIG_SCHEMA = cv.All( async def to_code(config): - hub = await cg.get_variable(config[CONF_NEXTION_ID]) var = cg.new_Pvariable(config[CONF_ID], hub) await cg.register_component(var, config) diff --git a/esphome/components/pmsa003i/sensor.py b/esphome/components/pmsa003i/sensor.py index ceca791cd6..ef620614a2 100644 --- a/esphome/components/pmsa003i/sensor.py +++ b/esphome/components/pmsa003i/sensor.py @@ -122,7 +122,6 @@ async def to_code(config): cg.add(var.set_standard_units(config[CONF_STANDARD_UNITS])) for key, funcName in TYPES.items(): - if key in config: sens = await sensor.new_sensor(config[key]) cg.add(getattr(var, funcName)(sens)) diff --git a/esphome/components/script/__init__.py b/esphome/components/script/__init__.py index 907d7bf0e3..6337d89bcd 100644 --- a/esphome/components/script/__init__.py +++ b/esphome/components/script/__init__.py @@ -62,7 +62,6 @@ def assign_declare_id(value): def parameters_to_template(args): - template_args = [] func_args = [] script_arg_names = [] diff --git a/esphome/components/sht4x/sensor.py b/esphome/components/sht4x/sensor.py index 9fb8fc969e..e195bb9acc 100644 --- a/esphome/components/sht4x/sensor.py +++ b/esphome/components/sht4x/sensor.py @@ -98,7 +98,6 @@ async def to_code(config): cg.add(var.set_heater_duty_value(config[CONF_HEATER_MAX_DUTY])) for key, funcName in TYPES.items(): - if key in config: sens = await sensor.new_sensor(config[key]) cg.add(getattr(var, funcName)(sens)) diff --git a/esphome/dashboard/dashboard.py b/esphome/dashboard/dashboard.py index 0ff5362670..6c7188a4ac 100644 --- a/esphome/dashboard/dashboard.py +++ b/esphome/dashboard/dashboard.py @@ -977,7 +977,6 @@ class LogoutHandler(BaseHandler): class SecretKeysRequestHandler(BaseHandler): @authenticated def get(self): - filename = None for secret_filename in const.SECRETS_FILES: diff --git a/requirements_test.txt b/requirements_test.txt index 6f03f005d5..a1c0845089 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,6 +1,6 @@ pylint==2.15.10 flake8==6.0.0 # also change in .pre-commit-config.yaml when updating -black==22.12.0 # also change in .pre-commit-config.yaml when updating +black==23.1.0 # also change in .pre-commit-config.yaml when updating pyupgrade==3.3.1 # also change in .pre-commit-config.yaml when updating pre-commit