From 146cab5bfc6187d5f642da4012680a39c3a225ae Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 01:58:59 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- custom_components/bodymiscale/__init__.py | 1 + custom_components/bodymiscale/config_flow.py | 25 ++++++++++++------- custom_components/bodymiscale/group.py | 1 - .../bodymiscale/metrics/__init__.py | 1 - .../bodymiscale/metrics/body_score.py | 1 + .../bodymiscale/metrics/impedance.py | 1 + .../bodymiscale/metrics/scale.py | 1 + custom_components/bodymiscale/models.py | 1 + custom_components/bodymiscale/sensor.py | 6 +++-- custom_components/bodymiscale/util.py | 1 - 10 files changed, 25 insertions(+), 14 deletions(-) diff --git a/custom_components/bodymiscale/__init__.py b/custom_components/bodymiscale/__init__.py index 0bd4d48..6338ab5 100644 --- a/custom_components/bodymiscale/__init__.py +++ b/custom_components/bodymiscale/__init__.py @@ -1,4 +1,5 @@ """Support for bodymiscale.""" + import asyncio import logging from collections.abc import MutableMapping diff --git a/custom_components/bodymiscale/config_flow.py b/custom_components/bodymiscale/config_flow.py index 85b9318..3d68a39 100644 --- a/custom_components/bodymiscale/config_flow.py +++ b/custom_components/bodymiscale/config_flow.py @@ -1,4 +1,5 @@ """Config flow to configure the bodymiscale integration.""" + from __future__ import annotations from types import MappingProxyType @@ -36,9 +37,11 @@ def _get_options_schema( { vol.Required( CONF_HEIGHT, - description={"suggested_value": defaults[CONF_HEIGHT]} - if CONF_HEIGHT in defaults - else None, + description=( + {"suggested_value": defaults[CONF_HEIGHT]} + if CONF_HEIGHT in defaults + else None + ), ): selector( { "number": { @@ -51,15 +54,19 @@ def _get_options_schema( ), vol.Required( CONF_SENSOR_WEIGHT, - description={"suggested_value": defaults[CONF_SENSOR_WEIGHT]} - if CONF_SENSOR_WEIGHT in defaults - else None, + description=( + {"suggested_value": defaults[CONF_SENSOR_WEIGHT]} + if CONF_SENSOR_WEIGHT in defaults + else None + ), ): selector({"entity": {"domain": ["sensor", "input_number", "number"]}}), vol.Optional( CONF_SENSOR_IMPEDANCE, - description={"suggested_value": defaults[CONF_SENSOR_IMPEDANCE]} - if CONF_SENSOR_IMPEDANCE in defaults - else None, + description=( + {"suggested_value": defaults[CONF_SENSOR_IMPEDANCE]} + if CONF_SENSOR_IMPEDANCE in defaults + else None + ), ): selector({"entity": {"domain": ["sensor", "input_number", "number"]}}), } ) diff --git a/custom_components/bodymiscale/group.py b/custom_components/bodymiscale/group.py index bad53d6..89f8c6a 100644 --- a/custom_components/bodymiscale/group.py +++ b/custom_components/bodymiscale/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import STATE_OK, STATE_PROBLEM from homeassistant.core import HomeAssistant, callback diff --git a/custom_components/bodymiscale/metrics/__init__.py b/custom_components/bodymiscale/metrics/__init__.py index 2ab704b..154bfe9 100644 --- a/custom_components/bodymiscale/metrics/__init__.py +++ b/custom_components/bodymiscale/metrics/__init__.py @@ -1,6 +1,5 @@ """Metrics module.""" - import logging from collections.abc import Callable, Mapping, MutableMapping from dataclasses import dataclass, field diff --git a/custom_components/bodymiscale/metrics/body_score.py b/custom_components/bodymiscale/metrics/body_score.py index ac5fccc..8ce50ac 100644 --- a/custom_components/bodymiscale/metrics/body_score.py +++ b/custom_components/bodymiscale/metrics/body_score.py @@ -1,4 +1,5 @@ """Body score module.""" + from collections import namedtuple from collections.abc import Mapping from typing import Any diff --git a/custom_components/bodymiscale/metrics/impedance.py b/custom_components/bodymiscale/metrics/impedance.py index 1bb0358..cef8b2b 100644 --- a/custom_components/bodymiscale/metrics/impedance.py +++ b/custom_components/bodymiscale/metrics/impedance.py @@ -1,4 +1,5 @@ """Metrics module, which require impedance.""" + from collections.abc import Mapping from typing import Any diff --git a/custom_components/bodymiscale/metrics/scale.py b/custom_components/bodymiscale/metrics/scale.py index 590f1d3..ff2fbfd 100644 --- a/custom_components/bodymiscale/metrics/scale.py +++ b/custom_components/bodymiscale/metrics/scale.py @@ -1,4 +1,5 @@ """Body scale module.""" + from functools import cached_property from ..models import Gender diff --git a/custom_components/bodymiscale/models.py b/custom_components/bodymiscale/models.py index 90f1f76..be0a4c2 100644 --- a/custom_components/bodymiscale/models.py +++ b/custom_components/bodymiscale/models.py @@ -1,4 +1,5 @@ """Models module.""" + from enum import Enum from .const import ( diff --git a/custom_components/bodymiscale/sensor.py b/custom_components/bodymiscale/sensor.py index 95fb41e..cc7684d 100644 --- a/custom_components/bodymiscale/sensor.py +++ b/custom_components/bodymiscale/sensor.py @@ -1,4 +1,5 @@ """Sensor module.""" + from collections.abc import Callable, Mapping from typing import Any @@ -185,8 +186,9 @@ def __init__( handler: BodyScaleMetricsHandler, entity_description: SensorEntityDescription, metric: Metric, - get_attributes: None - | (Callable[[StateType, Mapping[str, Any]], Mapping[str, Any]]) = None, + get_attributes: None | ( + Callable[[StateType, Mapping[str, Any]], Mapping[str, Any]] + ) = None, ): super().__init__(handler, entity_description) self._metric = metric diff --git a/custom_components/bodymiscale/util.py b/custom_components/bodymiscale/util.py index dcb5dc5..252567b 100644 --- a/custom_components/bodymiscale/util.py +++ b/custom_components/bodymiscale/util.py @@ -1,6 +1,5 @@ """Util module.""" - from collections.abc import Mapping from datetime import datetime from typing import Any