From d78e9e6aa8929aab3a5d6c600072f99dac831cd9 Mon Sep 17 00:00:00 2001 From: RoboMagus <68224306+RoboMagus@users.noreply.github.com> Date: Mon, 3 Apr 2023 21:31:11 +0200 Subject: [PATCH 1/6] Number step not optional (#4649) * Number step not optional * Update __init__.py * Update __init__.py --------- Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> --- esphome/components/number/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/esphome/components/number/__init__.py b/esphome/components/number/__init__.py index 7dce625389..f532f4e405 100644 --- a/esphome/components/number/__init__.py +++ b/esphome/components/number/__init__.py @@ -1,4 +1,3 @@ -from typing import Optional import esphome.codegen as cg import esphome.config_validation as cv from esphome import automation @@ -252,9 +251,7 @@ async def register_number( ) -async def new_number( - config, *, min_value: float, max_value: float, step: Optional[float] = None -): +async def new_number(config, *, min_value: float, max_value: float, step: float): var = cg.new_Pvariable(config[CONF_ID]) await register_number( var, config, min_value=min_value, max_value=max_value, step=step From 99638190cb26a078135d8183825a4317b5a44841 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Tue, 4 Apr 2023 07:44:46 +1200 Subject: [PATCH 2/6] VSCode / devcontainer updates (#4647) --- .devcontainer/devcontainer.json | 91 ++++++++++++++++++--------------- .vscode/tasks.json | 15 ++++-- script/setup | 6 +++ 3 files changed, 67 insertions(+), 45 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1f9a98d7ec..b3fa6d4932 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -4,53 +4,60 @@ "postCreateCommand": [ "script/devcontainer-post-create" ], + "containerEnv": { + "DEVCONTAINER": "1" + }, "runArgs": [ "--privileged", "-e", "ESPHOME_DASHBOARD_USE_PING=1" ], "appPort": 6052, - "extensions": [ - // python - "ms-python.python", - "visualstudioexptteam.vscodeintellicode", - // yaml - "redhat.vscode-yaml", - // cpp - "ms-vscode.cpptools", - // editorconfig - "editorconfig.editorconfig", - ], - "settings": { - "python.languageServer": "Pylance", - "python.pythonPath": "/usr/bin/python3", - "python.linting.pylintEnabled": true, - "python.linting.enabled": true, - "python.formatting.provider": "black", - "editor.formatOnPaste": false, - "editor.formatOnSave": true, - "editor.formatOnType": true, - "files.trimTrailingWhitespace": true, - "terminal.integrated.defaultProfile.linux": "bash", - "yaml.customTags": [ - "!secret scalar", - "!lambda scalar", - "!include_dir_named scalar", - "!include_dir_list scalar", - "!include_dir_merge_list scalar", - "!include_dir_merge_named scalar" - ], - "files.exclude": { - "**/.git": true, - "**/.DS_Store": true, - "**/*.pyc": { - "when": "$(basename).py" - }, - "**/__pycache__": true - }, - "files.associations": { - "**/.vscode/*.json": "jsonc" - }, - "C_Cpp.clang_format_path": "/usr/bin/clang-format-13", + "customizations": { + "vscode": { + "extensions": [ + // python + "ms-python.python", + "visualstudioexptteam.vscodeintellicode", + // yaml + "redhat.vscode-yaml", + // cpp + "ms-vscode.cpptools", + // editorconfig + "editorconfig.editorconfig", + ], + "settings": { + "python.languageServer": "Pylance", + "python.pythonPath": "/usr/bin/python3", + "python.linting.pylintEnabled": true, + "python.linting.enabled": true, + "python.formatting.provider": "black", + "editor.formatOnPaste": false, + "editor.formatOnSave": true, + "editor.formatOnType": true, + "files.trimTrailingWhitespace": true, + "terminal.integrated.defaultProfile.linux": "bash", + "yaml.customTags": [ + "!secret scalar", + "!lambda scalar", + "!include_dir_named scalar", + "!include_dir_list scalar", + "!include_dir_merge_list scalar", + "!include_dir_merge_named scalar" + ], + "files.exclude": { + "**/.git": true, + "**/.DS_Store": true, + "**/*.pyc": { + "when": "$(basename).py" + }, + "**/__pycache__": true + }, + "files.associations": { + "**/.vscode/*.json": "jsonc" + }, + "C_Cpp.clang_format_path": "/usr/bin/clang-format-13" + } + } } } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index b6584bc735..307dd496f0 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -2,15 +2,24 @@ "version": "2.0.0", "tasks": [ { - "label": "run", + "label": "Run Dashboard", "type": "shell", - "command": "python3 -m esphome dashboard config/", + "command": "${command:python.interpreterPath}", + "args": [ + "-m", + "esphome", + "dashboard", + "config/" + ], "problemMatcher": [] }, { "label": "clang-tidy", "type": "shell", - "command": "./script/clang-tidy", + "command": "${command:python.interpreterPath}", + "args": [ + "./script/clang-tidy" + ], "problemMatcher": [ { "owner": "clang-tidy", diff --git a/script/setup b/script/setup index 71828deeaa..c650960f05 100755 --- a/script/setup +++ b/script/setup @@ -4,6 +4,12 @@ set -e cd "$(dirname "$0")/.." + +if [ ! -n "$DEVCONTAINER" ] && [ ! -n "$VIRTUAL_ENV" ]; then + python3 -m venv venv + source venv/bin/activate +fi + pip3 install -r requirements.txt -r requirements_optional.txt -r requirements_test.txt pip3 install --no-use-pep517 -e . From fbc129ccccbdb8ed9495903c8dc7a7334c909197 Mon Sep 17 00:00:00 2001 From: tracestep <16390082+tracestep@users.noreply.github.com> Date: Mon, 3 Apr 2023 19:23:31 -0300 Subject: [PATCH 3/6] Version retry (fixes esphome/issues#3823) (#4651) --- esphome/components/pn532/pn532.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/esphome/components/pn532/pn532.cpp b/esphome/components/pn532/pn532.cpp index 7ebf328cff..dc831ef6e0 100644 --- a/esphome/components/pn532/pn532.cpp +++ b/esphome/components/pn532/pn532.cpp @@ -19,9 +19,12 @@ void PN532::setup() { // Get version data if (!this->write_command_({PN532_COMMAND_VERSION_DATA})) { - ESP_LOGE(TAG, "Error sending version command"); - this->mark_failed(); - return; + ESP_LOGW(TAG, "Error sending version command, trying again..."); + if (!this->write_command_({PN532_COMMAND_VERSION_DATA})) { + ESP_LOGE(TAG, "Error sending version command"); + this->mark_failed(); + return; + } } std::vector version_data; From 9c9bc58c16a435fedb46d115a98debe8c35acaf7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Apr 2023 11:55:00 +1200 Subject: [PATCH 4/6] Bump pylint from 2.16.4 to 2.17.2 (#4650) * Bump pylint from 2.16.4 to 2.17.2 Bumps [pylint](https://github.com/PyCQA/pylint) from 2.16.4 to 2.17.2. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.16.4...v2.17.2) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Add return 0 to run_miniterm --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> --- esphome/__main__.py | 2 ++ requirements_test.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/esphome/__main__.py b/esphome/__main__.py index 24c2ce1d13..78320a05f0 100644 --- a/esphome/__main__.py +++ b/esphome/__main__.py @@ -152,6 +152,8 @@ def run_miniterm(config, port): _LOGGER.error("Could not connect to serial port %s", port) return 1 + return 0 + def wrap_to_code(name, comp): coro = coroutine(comp.to_code) diff --git a/requirements_test.txt b/requirements_test.txt index 3e59023d20..b2c60b3db3 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,4 +1,4 @@ -pylint==2.16.4 +pylint==2.17.2 flake8==6.0.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 From 42401775e1920431e71804913dda31d6bcdbe94d Mon Sep 17 00:00:00 2001 From: Ben Hoff Date: Mon, 3 Apr 2023 22:34:14 -0400 Subject: [PATCH 5/6] Added in mmc5603 code (#4175) * added in mmc5603 code * added in codeowner * fix linter errors * whitespace linter errors * added codeowner * clang format * remove clang format from python code * fix whitespace * add tests * fix test * make requested edits * remove status manipulation --------- Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> --- CODEOWNERS | 1 + esphome/components/mmc5603/__init__.py | 1 + esphome/components/mmc5603/mmc5603.cpp | 162 +++++++++++++++++++++++++ esphome/components/mmc5603/mmc5603.h | 43 +++++++ esphome/components/mmc5603/sensor.py | 91 ++++++++++++++ tests/test1.yaml | 9 ++ 6 files changed, 307 insertions(+) create mode 100644 esphome/components/mmc5603/__init__.py create mode 100644 esphome/components/mmc5603/mmc5603.cpp create mode 100644 esphome/components/mmc5603/mmc5603.h create mode 100644 esphome/components/mmc5603/sensor.py diff --git a/CODEOWNERS b/CODEOWNERS index c006db2a6a..76156db6e6 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -159,6 +159,7 @@ esphome/components/midea/* @dudanov esphome/components/midea_ir/* @dudanov esphome/components/mitsubishi/* @RubyBailey esphome/components/mlx90393/* @functionpointer +esphome/components/mmc5603/* @benhoff esphome/components/modbus_controller/* @martgras esphome/components/modbus_controller/binary_sensor/* @martgras esphome/components/modbus_controller/number/* @martgras diff --git a/esphome/components/mmc5603/__init__.py b/esphome/components/mmc5603/__init__.py new file mode 100644 index 0000000000..cc88f26231 --- /dev/null +++ b/esphome/components/mmc5603/__init__.py @@ -0,0 +1 @@ +CODEOWNERS = ["@benhoff"] diff --git a/esphome/components/mmc5603/mmc5603.cpp b/esphome/components/mmc5603/mmc5603.cpp new file mode 100644 index 0000000000..6fbf4810f2 --- /dev/null +++ b/esphome/components/mmc5603/mmc5603.cpp @@ -0,0 +1,162 @@ +#include "mmc5603.h" +#include "esphome/core/log.h" + +namespace esphome { +namespace mmc5603 { + +static const char *const TAG = "mmc5603"; +static const uint8_t MMC5603_ADDRESS = 0x30; +static const uint8_t MMC56X3_PRODUCT_ID = 0x39; + +static const uint8_t MMC56X3_DEFAULT_ADDRESS = 0x30; +static const uint8_t MMC56X3_CHIP_ID = 0x10; + +static const uint8_t MMC56X3_ADDR_XOUT0 = 0x00; +static const uint8_t MMC56X3_ADDR_XOUT1 = 0x01; +static const uint8_t MMC56X3_ADDR_XOUT2 = 0x06; + +static const uint8_t MMC56X3_ADDR_YOUT0 = 0x02; +static const uint8_t MMC56X3_ADDR_YOUT1 = 0x03; +static const uint8_t MMC56X3_ADDR_YOUT2 = 0x07; + +static const uint8_t MMC56X3_ADDR_ZOUT0 = 0x04; +static const uint8_t MMC56X3_ADDR_ZOUT1 = 0x05; +static const uint8_t MMC56X3_ADDR_ZOUT2 = 0x08; + +static const uint8_t MMC56X3_OUT_TEMP = 0x09; +static const uint8_t MMC56X3_STATUS_REG = 0x18; +static const uint8_t MMC56X3_CTRL0_REG = 0x1B; +static const uint8_t MMC56X3_CTRL1_REG = 0x1C; +static const uint8_t MMC56X3_CTRL2_REG = 0x1D; +static const uint8_t MMC5603_ODR_REG = 0x1A; + +void MMC5603Component::setup() { + ESP_LOGCONFIG(TAG, "Setting up MMC5603..."); + uint8_t id = 0; + if (!this->read_byte(MMC56X3_PRODUCT_ID, &id)) { + this->error_code_ = COMMUNICATION_FAILED; + this->mark_failed(); + return; + } + + if (id != MMC56X3_CHIP_ID) { + ESP_LOGCONFIG(TAG, "Chip Wrong"); + this->error_code_ = ID_REGISTERS; + this->mark_failed(); + return; + } + + if (!this->write_byte(MMC56X3_CTRL1_REG, 0x80)) { // turn on set bit + ESP_LOGCONFIG(TAG, "Control 1 Failed for set bit"); + this->error_code_ = COMMUNICATION_FAILED; + this->mark_failed(); + return; + } + + if (!this->write_byte(MMC56X3_CTRL0_REG, 0x08)) { // turn on set bit + ESP_LOGCONFIG(TAG, "Control 0 Failed for set bit"); + this->error_code_ = COMMUNICATION_FAILED; + this->mark_failed(); + return; + } + + if (!this->write_byte(MMC56X3_CTRL0_REG, 0x10)) { + this->error_code_ = COMMUNICATION_FAILED; + this->mark_failed(); + return; + } + + uint8_t ctrl_2 = 0; + + ctrl_2 &= ~0x10; // turn off cmm_en bit + if (!this->write_byte(MMC56X3_CTRL2_REG, ctrl_2)) { + this->error_code_ = COMMUNICATION_FAILED; + this->mark_failed(); + return; + } +} +void MMC5603Component::dump_config() { + ESP_LOGCONFIG(TAG, "MMC5603:"); + LOG_I2C_DEVICE(this); + if (this->error_code_ == COMMUNICATION_FAILED) { + ESP_LOGE(TAG, "Communication with MMC5603 failed!"); + } else if (this->error_code_ == ID_REGISTERS) { + ESP_LOGE(TAG, "The ID registers don't match - Is this really an MMC5603?"); + } + LOG_UPDATE_INTERVAL(this); + + LOG_SENSOR(" ", "X Axis", this->x_sensor_); + LOG_SENSOR(" ", "Y Axis", this->y_sensor_); + LOG_SENSOR(" ", "Z Axis", this->z_sensor_); + LOG_SENSOR(" ", "Heading", this->heading_sensor_); +} + +float MMC5603Component::get_setup_priority() const { return setup_priority::DATA; } + +void MMC5603Component::update() { + if (!this->write_byte(MMC56X3_CTRL0_REG, 0x01)) { + this->status_set_warning(); + return; + } + uint8_t status = 0; + if (!this->read_byte(MMC56X3_STATUS_REG, &status)) { + this->status_set_warning(); + return; + } + + uint8_t buffer[9] = {0}; + + if (!this->read_byte(MMC56X3_ADDR_XOUT0, &buffer[0]) || !this->read_byte(MMC56X3_ADDR_XOUT1, &buffer[1]) || + !this->read_byte(MMC56X3_ADDR_XOUT2, &buffer[2])) { + this->status_set_warning(); + return; + } + + if (!this->read_byte(MMC56X3_ADDR_YOUT0, &buffer[3]) || !this->read_byte(MMC56X3_ADDR_YOUT1, &buffer[4]) || + !this->read_byte(MMC56X3_ADDR_YOUT2, &buffer[5])) { + this->status_set_warning(); + return; + } + + if (!this->read_byte(MMC56X3_ADDR_ZOUT0, &buffer[6]) || !this->read_byte(MMC56X3_ADDR_ZOUT1, &buffer[7]) || + !this->read_byte(MMC56X3_ADDR_ZOUT2, &buffer[8])) { + this->status_set_warning(); + return; + } + + int32_t raw_x = 0; + raw_x |= buffer[0] << 12; + raw_x |= buffer[1] << 4; + raw_x |= buffer[2] << 0; + + const float x = 0.0625 * (raw_x - 524288); + + int32_t raw_y = 0; + raw_y |= buffer[3] << 12; + raw_y |= buffer[4] << 4; + raw_y |= buffer[5] << 0; + + const float y = 0.0625 * (raw_y - 524288); + + int32_t raw_z = 0; + raw_z |= buffer[6] << 12; + raw_z |= buffer[7] << 4; + raw_z |= buffer[8] << 0; + + const float z = 0.0625 * (raw_z - 524288); + + const float heading = atan2f(0.0f - x, y) * 180.0f / M_PI; + ESP_LOGD(TAG, "Got x=%0.02fµT y=%0.02fµT z=%0.02fµT heading=%0.01f°", x, y, z, heading); + + if (this->x_sensor_ != nullptr) + this->x_sensor_->publish_state(x); + if (this->y_sensor_ != nullptr) + this->y_sensor_->publish_state(y); + if (this->z_sensor_ != nullptr) + this->z_sensor_->publish_state(z); + if (this->heading_sensor_ != nullptr) + this->heading_sensor_->publish_state(heading); +} + +} // namespace mmc5603 +} // namespace esphome diff --git a/esphome/components/mmc5603/mmc5603.h b/esphome/components/mmc5603/mmc5603.h new file mode 100644 index 0000000000..cd0893053c --- /dev/null +++ b/esphome/components/mmc5603/mmc5603.h @@ -0,0 +1,43 @@ +#pragma once + +#include "esphome/core/component.h" +#include "esphome/components/sensor/sensor.h" +#include "esphome/components/i2c/i2c.h" + +namespace esphome { +namespace mmc5603 { + +enum MMC5603Datarate { + MMC5603_DATARATE_75_0_HZ, + MMC5603_DATARATE_150_0_HZ, + MMC5603_DATARATE_255_0_HZ, +}; + +class MMC5603Component : public PollingComponent, public i2c::I2CDevice { + public: + void setup() override; + void dump_config() override; + float get_setup_priority() const override; + void update() override; + + void set_datarate(MMC5603Datarate datarate) { datarate_ = datarate; } + void set_x_sensor(sensor::Sensor *x_sensor) { x_sensor_ = x_sensor; } + void set_y_sensor(sensor::Sensor *y_sensor) { y_sensor_ = y_sensor; } + void set_z_sensor(sensor::Sensor *z_sensor) { z_sensor_ = z_sensor; } + void set_heading_sensor(sensor::Sensor *heading_sensor) { heading_sensor_ = heading_sensor; } + + protected: + MMC5603Datarate datarate_; + sensor::Sensor *x_sensor_{nullptr}; + sensor::Sensor *y_sensor_{nullptr}; + sensor::Sensor *z_sensor_{nullptr}; + sensor::Sensor *heading_sensor_{nullptr}; + enum ErrorCode { + NONE = 0, + COMMUNICATION_FAILED, + ID_REGISTERS, + } error_code_; +}; + +} // namespace mmc5603 +} // namespace esphome diff --git a/esphome/components/mmc5603/sensor.py b/esphome/components/mmc5603/sensor.py new file mode 100644 index 0000000000..348a0e7dcc --- /dev/null +++ b/esphome/components/mmc5603/sensor.py @@ -0,0 +1,91 @@ +import esphome.codegen as cg +import esphome.config_validation as cv +from esphome.components import i2c, sensor +from esphome.const import ( + CONF_ADDRESS, + CONF_ID, + ICON_MAGNET, + STATE_CLASS_MEASUREMENT, + UNIT_MICROTESLA, + UNIT_DEGREES, + ICON_SCREEN_ROTATION, + CONF_UPDATE_INTERVAL, +) + +DEPENDENCIES = ["i2c"] + +mmc5603_ns = cg.esphome_ns.namespace("mmc5603") + +CONF_FIELD_STRENGTH_X = "field_strength_x" +CONF_FIELD_STRENGTH_Y = "field_strength_y" +CONF_FIELD_STRENGTH_Z = "field_strength_z" +CONF_HEADING = "heading" + +MMC5603Component = mmc5603_ns.class_( + "MMC5603Component", cg.PollingComponent, i2c.I2CDevice +) + + +MMC5603Datarate = mmc5603_ns.enum("MMC5603Datarate") +MMC5603Datarates = { + 75: MMC5603Datarate.MMC5603_DATARATE_75_0_HZ, + 150: MMC5603Datarate.MMC5603_DATARATE_150_0_HZ, + 255: MMC5603Datarate.MMC5603_DATARATE_255_0_HZ, +} + + +field_strength_schema = sensor.sensor_schema( + unit_of_measurement=UNIT_MICROTESLA, + icon=ICON_MAGNET, + accuracy_decimals=1, + state_class=STATE_CLASS_MEASUREMENT, +) +heading_schema = sensor.sensor_schema( + unit_of_measurement=UNIT_DEGREES, + icon=ICON_SCREEN_ROTATION, + accuracy_decimals=1, +) + +CONFIG_SCHEMA = ( + cv.Schema( + { + cv.GenerateID(): cv.declare_id(MMC5603Component), + cv.Optional(CONF_ADDRESS): cv.i2c_address, + cv.Optional(CONF_FIELD_STRENGTH_X): field_strength_schema, + cv.Optional(CONF_FIELD_STRENGTH_Y): field_strength_schema, + cv.Optional(CONF_FIELD_STRENGTH_Z): field_strength_schema, + cv.Optional(CONF_HEADING): heading_schema, + } + ) + .extend(cv.polling_component_schema("60s")) + .extend(i2c.i2c_device_schema(0x1E)) +) + + +def auto_data_rate(config): + interval_msec = config[CONF_UPDATE_INTERVAL].total_milliseconds + interval_hz = 1000.0 / interval_msec + for datarate in sorted(MMC5603Datarates.keys()): + if float(datarate) >= interval_hz: + return MMC5603Datarates[datarate] + return MMC5603Datarates[75] + + +async def to_code(config): + var = cg.new_Pvariable(config[CONF_ID]) + await cg.register_component(var, config) + await i2c.register_i2c_device(var, config) + + cg.add(var.set_datarate(auto_data_rate(config))) + if CONF_FIELD_STRENGTH_X in config: + sens = await sensor.new_sensor(config[CONF_FIELD_STRENGTH_X]) + cg.add(var.set_x_sensor(sens)) + if CONF_FIELD_STRENGTH_Y in config: + sens = await sensor.new_sensor(config[CONF_FIELD_STRENGTH_Y]) + cg.add(var.set_y_sensor(sens)) + if CONF_FIELD_STRENGTH_Z in config: + sens = await sensor.new_sensor(config[CONF_FIELD_STRENGTH_Z]) + cg.add(var.set_z_sensor(sens)) + if CONF_HEADING in config: + sens = await sensor.new_sensor(config[CONF_HEADING]) + cg.add(var.set_heading_sensor(sens)) diff --git a/tests/test1.yaml b/tests/test1.yaml index 5be6395729..c2a2ed5c95 100644 --- a/tests/test1.yaml +++ b/tests/test1.yaml @@ -831,6 +831,15 @@ sensor: temperature: name: MPU6886 Temperature i2c_id: i2c_bus + - platform: mmc5603 + address: 0x30 + field_strength_x: + name: HMC5883L Field Strength X + field_strength_y: + name: HMC5883L Field Strength Y + field_strength_z: + name: HMC5883L Field Strength Z + i2c_id: i2c_bus - platform: dps310 temperature: name: DPS310 Temperature From b56fa8c50aa302ec8bbfa4b7e29d65118636f79b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Apr 2023 14:34:36 +1200 Subject: [PATCH 6/6] Bump black from 23.1.0 to 23.3.0 (#4635) * Bump black from 23.1.0 to 23.3.0 Bumps [black](https://github.com/psf/black) from 23.1.0 to 23.3.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.1.0...23.3.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update black in pre-commit --------- Signed-off-by: dependabot[bot] 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 | 4 ++-- requirements_test.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0de82cf2de..be82fc826b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,8 +2,8 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: - - repo: https://github.com/ambv/black - rev: 23.1.0 + - repo: https://github.com/psf/black + rev: 23.3.0 hooks: - id: black args: diff --git a/requirements_test.txt b/requirements_test.txt index b2c60b3db3..cbd0a75d8f 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,6 +1,6 @@ pylint==2.17.2 flake8==6.0.0 # also change in .pre-commit-config.yaml when updating -black==23.1.0 # also change in .pre-commit-config.yaml when updating +black==23.3.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