Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#220)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Feb 21, 2025
1 parent 7294b9a commit b91b339
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 21 deletions.
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ default_language_version:

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py310-plus]
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 25.1.0
hooks:
- id: black
args:
Expand All @@ -22,7 +22,7 @@ repos:
<<: &python-files-with-tests
files: ^((custom_components|tests)/.+)?[^/]+\.py$
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.1.2
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -31,7 +31,7 @@ repos:
<<: &python-files
files: ^(custom_components/.+)?[^/]+\.py$
- repo: https://github.com/PyCQA/bandit
rev: 1.7.6
rev: 1.8.3
hooks:
- id: bandit
args:
Expand All @@ -40,11 +40,11 @@ repos:
- --configfile=bandit.yaml
<<: *python-files-with-tests
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
rev: 6.0.0
hooks:
- id: isort
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-executables-have-shebangs
- id: check-merge-conflict
Expand All @@ -66,7 +66,7 @@ repos:
- python
exclude: manifest\.json$
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.33.0
rev: v1.35.1
hooks:
- id: yamllint
- repo: local
Expand Down
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
27 changes: 17 additions & 10 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 @@ -29,16 +30,18 @@

@callback # type: ignore[misc]
def _get_options_schema(
defaults: dict[str, Any] | MappingProxyType[str, Any]
defaults: dict[str, Any] | MappingProxyType[str, Any],
) -> vol.Schema:
"""Return options schema."""
return vol.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/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 b91b339

Please sign in to comment.