From 2b39988707a655c7745899f75d3946775f0de6a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Feb 2022 10:26:37 +0100 Subject: [PATCH] Bump black from 21.12b0 to 22.1.0 (#3147) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Otto winter --- .pre-commit-config.yaml | 2 +- esphome/components/cs5460a/sensor.py | 4 ++-- esphome/components/esp8266/boards.py | 2 +- esphome/components/ledc/output.py | 6 +++--- esphome/mqtt.py | 2 +- requirements_test.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 16564dc89..e38717fe5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/ambv/black - rev: 20.8b1 + rev: 22.1.0 hooks: - id: black args: diff --git a/esphome/components/cs5460a/sensor.py b/esphome/components/cs5460a/sensor.py index 82df881bf..d6e3c2ba4 100644 --- a/esphome/components/cs5460a/sensor.py +++ b/esphome/components/cs5460a/sensor.py @@ -49,8 +49,8 @@ def validate_config(config): if current_gain == 0.0 or voltage_gain == 0.0: raise cv.Invalid("The gains can't be zero") - max_energy = (0.25 * 0.25 / 3600 / (2 ** -4)) / (voltage_gain * current_gain) - min_energy = (0.25 * 0.25 / 3600 / (2 ** 18)) / (voltage_gain * current_gain) + max_energy = (0.25 * 0.25 / 3600 / (2**-4)) / (voltage_gain * current_gain) + min_energy = (0.25 * 0.25 / 3600 / (2**18)) / (voltage_gain * current_gain) mech_min_energy = (0.25 * 0.25 / 3600 / 7.8) / (voltage_gain * current_gain) if pulse_energy < min_energy or pulse_energy > max_energy: raise cv.Invalid( diff --git a/esphome/components/esp8266/boards.py b/esphome/components/esp8266/boards.py index 410e93461..8b0a23a00 100644 --- a/esphome/components/esp8266/boards.py +++ b/esphome/components/esp8266/boards.py @@ -1,4 +1,4 @@ -FLASH_SIZE_1_MB = 2 ** 20 +FLASH_SIZE_1_MB = 2**20 FLASH_SIZE_512_KB = FLASH_SIZE_1_MB // 2 FLASH_SIZE_2_MB = 2 * FLASH_SIZE_1_MB FLASH_SIZE_4_MB = 4 * FLASH_SIZE_1_MB diff --git a/esphome/components/ledc/output.py b/esphome/components/ledc/output.py index 895dcc998..f6dc89cd9 100644 --- a/esphome/components/ledc/output.py +++ b/esphome/components/ledc/output.py @@ -13,12 +13,12 @@ DEPENDENCIES = ["esp32"] def calc_max_frequency(bit_depth): - return 80e6 / (2 ** bit_depth) + return 80e6 / (2**bit_depth) def calc_min_frequency(bit_depth): - max_div_num = ((2 ** 20) - 1) / 256.0 - return 80e6 / (max_div_num * (2 ** bit_depth)) + max_div_num = ((2**20) - 1) / 256.0 + return 80e6 / (max_div_num * (2**bit_depth)) def validate_frequency(value): diff --git a/esphome/mqtt.py b/esphome/mqtt.py index 07602e8ce..0ddd97607 100644 --- a/esphome/mqtt.py +++ b/esphome/mqtt.py @@ -47,7 +47,7 @@ def initialize(config, subscriptions, on_message, username, password, client_id) except OSError: pass - wait_time = min(2 ** tries, 300) + wait_time = min(2**tries, 300) _LOGGER.warning( "Disconnected from MQTT (%s). Trying to reconnect in %s s", result_code, diff --git a/requirements_test.txt b/requirements_test.txt index 499e95048..45d8c0209 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,6 +1,6 @@ pylint==2.12.2 flake8==4.0.1 -black==21.12b0 +black==22.1.0 pre-commit # Unit tests