Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #220

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 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: 24.10.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.1
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.0
hooks:
- id: bandit
args:
Expand All @@ -44,7 +44,7 @@ repos:
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
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/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
Loading