Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 13, 2024
1 parent d599195 commit 146cab5
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 14 deletions.
1 change: 1 addition & 0 deletions custom_components/bodymiscale/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Support for bodymiscale."""

import asyncio
import logging
from collections.abc import MutableMapping
Expand Down
25 changes: 16 additions & 9 deletions custom_components/bodymiscale/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Config flow to configure the bodymiscale integration."""

from __future__ import annotations

from types import MappingProxyType
Expand Down Expand Up @@ -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": {
Expand All @@ -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"]}}),
}
)
Expand Down
1 change: 0 additions & 1 deletion custom_components/bodymiscale/group.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion custom_components/bodymiscale/metrics/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Metrics module."""


import logging
from collections.abc import Callable, Mapping, MutableMapping
from dataclasses import dataclass, field
Expand Down
1 change: 1 addition & 0 deletions custom_components/bodymiscale/metrics/body_score.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Body score module."""

from collections import namedtuple
from collections.abc import Mapping
from typing import Any
Expand Down
1 change: 1 addition & 0 deletions custom_components/bodymiscale/metrics/impedance.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Metrics module, which require impedance."""

from collections.abc import Mapping
from typing import Any

Expand Down
1 change: 1 addition & 0 deletions custom_components/bodymiscale/metrics/scale.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Body scale module."""

from functools import cached_property

from ..models import Gender
Expand Down
1 change: 1 addition & 0 deletions custom_components/bodymiscale/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Models module."""

from enum import Enum

from .const import (
Expand Down
6 changes: 4 additions & 2 deletions custom_components/bodymiscale/sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sensor module."""

from collections.abc import Callable, Mapping
from typing import Any

Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion custom_components/bodymiscale/util.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Util module."""


from collections.abc import Mapping
from datetime import datetime
from typing import Any
Expand Down

0 comments on commit 146cab5

Please sign in to comment.