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 9ef41cd commit ae0a50b
Show file tree
Hide file tree
Showing 9 changed files with 147 additions and 159 deletions.
15 changes: 9 additions & 6 deletions custom_components/average/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,36 @@
# Creative Commons BY-NC-SA 4.0 International Public License
# (see LICENSE.md or https://creativecommons.org/licenses/by-nc-sa/4.0/)

"""The Average Sensor.
"""
The Average Sensor.
For more details about this sensor, please refer to the documentation at
https://github.com/Limych/ha-average/
"""
from __future__ import annotations

import logging
from typing import TYPE_CHECKING

import voluptuous as vol

from homeassistant.const import SERVICE_RELOAD
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.helpers.reload import async_reload_integration_platforms
from homeassistant.helpers.typing import ConfigType

if TYPE_CHECKING:
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.helpers.typing import ConfigType

from .const import DOMAIN, PLATFORMS, STARTUP_MESSAGE

_LOGGER = logging.getLogger(__name__)


async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: # noqa: ARG001
"""Set up the platforms."""
# Print startup message
_LOGGER.info(STARTUP_MESSAGE)

async def reload_service_handler(service: ServiceCall) -> None:
async def reload_service_handler(service: ServiceCall) -> None: # noqa: ARG001
"""Reload all average sensors from config."""
await async_reload_integration_platforms(hass, DOMAIN, PLATFORMS)

Expand Down
5 changes: 3 additions & 2 deletions custom_components/average/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The Average Sensor.
"""
The Average Sensor.
For more details about this sensor, please refer to the documentation at
https://github.com/Limych/ha-average/
Expand All @@ -7,9 +8,9 @@
from datetime import timedelta
from typing import Final

# Base component constants
from homeassistant.const import Platform

# Base component constants
NAME: Final = "Average Sensor"
DOMAIN: Final = "average"
VERSION: Final = "2.3.5-alpha"
Expand Down
4 changes: 3 additions & 1 deletion custom_components/average/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"documentation": "https://github.com/Limych/ha-average",
"iot_class": "calculated",
"issue_tracker": "https://github.com/Limych/ha-average/issues",
"requirements": [],
"requirements": [
"pip>=21.3.1"
],
"version": "2.3.5-alpha"
}
Loading

0 comments on commit ae0a50b

Please sign in to comment.