Skip to content

Commit

Permalink
Fix code beauty with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
Limych committed Oct 6, 2024
1 parent 2826498 commit f31592c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion custom_components/average/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2022, Andrey "Limych" Khrolenok <andrey@khrolenok.ru>
# Copyright (c) 2019-2024, Andrey "Limych" Khrolenok <andrey@khrolenok.ru>
# Creative Commons BY-NC-SA 4.0 International Public License
# (see LICENSE.md or https://creativecommons.org/licenses/by-nc-sa/4.0/)

Expand All @@ -8,6 +8,7 @@
For more details about this sensor, please refer to the documentation at
https://github.com/Limych/ha-average/
"""

from __future__ import annotations

import logging
Expand Down
9 changes: 5 additions & 4 deletions custom_components/average/sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2022, Andrey "Limych" Khrolenok <andrey@khrolenok.ru>
# Copyright (c) 2019-2024, Andrey "Limych" Khrolenok <andrey@khrolenok.ru>
# Creative Commons BY-NC-SA 4.0 International Public License
# (see LICENSE.md or https://creativecommons.org/licenses/by-nc-sa/4.0/)

Expand All @@ -8,6 +8,7 @@
For more details about this sensor, please refer to the documentation at
https://github.com/Limych/ha-average/
"""

from __future__ import annotations

import logging
Expand All @@ -21,9 +22,10 @@
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType

from _sha1 import sha1

import homeassistant.util.dt as dt_util
import voluptuous as vol
from _sha1 import sha1
from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN
from homeassistant.components.recorder import get_instance, history
from homeassistant.components.sensor import (
Expand Down Expand Up @@ -91,8 +93,7 @@ def check_period_keys(conf: ConfigType) -> ConfigType:
raise vol.Invalid(
"You must provide none, only "
+ CONF_DURATION
+ " or maximum 2 of the following: "
", ".join(CONF_PERIOD_KEYS)
+ " or maximum 2 of the following: " ", ".join(CONF_PERIOD_KEYS)
)
return conf

Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# pylint: disable=protected-access,redefined-outer-name
"""Global fixtures for integration."""

# Fixtures allow you to replace functions with a Mock object. You can perform
# many options via the Mock to reflect a particular behavior from the original
# function that you want to see without going through the function's actual logic.
Expand Down

0 comments on commit f31592c

Please sign in to comment.