diff --git a/bin/gen_releasenotes b/bin/gen_releasenotes index 52237a8..f6e59c9 100755 --- a/bin/gen_releasenotes +++ b/bin/gen_releasenotes @@ -1,11 +1,11 @@ #!/usr/bin/env python3 """Helper script to generate release notes.""" import argparse +from datetime import datetime import logging import os import re import subprocess -from datetime import datetime from typing import List, Optional, Tuple from github import Github, GithubException, Repository, Tag diff --git a/custom_components/integration_blueprint/__init__.py b/custom_components/integration_blueprint/__init__.py index fcea637..aa5929c 100644 --- a/custom_components/integration_blueprint/__init__.py +++ b/custom_components/integration_blueprint/__init__.py @@ -1,12 +1,11 @@ -""" -Custom integration to integrate integration_blueprint with Home Assistant. +"""Custom integration to integrate integration_blueprint with Home Assistant. For more details about this integration, please refer to https://github.com/Limych/ha-blueprint """ import asyncio -import logging from datetime import timedelta +import logging from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_PASSWORD, CONF_USERNAME diff --git a/custom_components/integration_blueprint/config_flow.py b/custom_components/integration_blueprint/config_flow.py index 3d41937..b422fce 100644 --- a/custom_components/integration_blueprint/config_flow.py +++ b/custom_components/integration_blueprint/config_flow.py @@ -2,6 +2,7 @@ from typing import Optional import voluptuous as vol + from homeassistant import config_entries from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_PASSWORD, CONF_USERNAME diff --git a/requirements-dev.txt b/requirements-dev.txt index 1418a90..6b126ad 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ -r requirements-test.txt -black==22.10.0 -packaging==21.3 -pre-commit~=2.20 +black==23.1.0 +packaging==23.0 +pre-commit~=3.0 PyGithub~=1.57 pyupgrade~=3.3 yamllint~=1.28 diff --git a/tests/test__init.py b/tests/test__init.py index 9011ebe..b2f5e21 100644 --- a/tests/test__init.py +++ b/tests/test__init.py @@ -2,8 +2,6 @@ """Test integration_blueprint setup process.""" import pytest -from homeassistant.core import HomeAssistant -from homeassistant.exceptions import ConfigEntryNotReady from pytest_homeassistant_custom_component.common import MockConfigEntry from custom_components.integration_blueprint import ( @@ -13,6 +11,8 @@ async_unload_entry, ) from custom_components.integration_blueprint.const import DOMAIN +from homeassistant.core import HomeAssistant +from homeassistant.exceptions import ConfigEntryNotReady from .const import MOCK_CONFIG diff --git a/tests/test_api.py b/tests/test_api.py index 1861387..6c7b979 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -4,11 +4,11 @@ import asyncio import aiohttp -from homeassistant.core import HomeAssistant -from homeassistant.helpers.aiohttp_client import async_get_clientsession from pytest import raises from custom_components.integration_blueprint.api import IntegrationBlueprintApiClient +from homeassistant.core import HomeAssistant +from homeassistant.helpers.aiohttp_client import async_get_clientsession async def test_api(hass: HomeAssistant, aioclient_mock, caplog): diff --git a/tests/test_config_flow.py b/tests/test_config_flow.py index 11934ca..15a4d44 100644 --- a/tests/test_config_flow.py +++ b/tests/test_config_flow.py @@ -4,12 +4,12 @@ from unittest.mock import patch import pytest -from homeassistant import config_entries, data_entry_flow -from homeassistant.const import Platform -from homeassistant.core import HomeAssistant from pytest_homeassistant_custom_component.common import MockConfigEntry from custom_components.integration_blueprint.const import DOMAIN, PLATFORMS +from homeassistant import config_entries, data_entry_flow +from homeassistant.const import Platform +from homeassistant.core import HomeAssistant from .const import MOCK_CONFIG diff --git a/tests/test_switch.py b/tests/test_switch.py index de9c542..2f5f22b 100644 --- a/tests/test_switch.py +++ b/tests/test_switch.py @@ -3,9 +3,6 @@ from unittest.mock import call, patch -from homeassistant.components.switch import SERVICE_TURN_OFF, SERVICE_TURN_ON -from homeassistant.const import ATTR_ENTITY_ID, Platform -from homeassistant.core import HomeAssistant from pytest_homeassistant_custom_component.common import MockConfigEntry from custom_components.integration_blueprint import ( @@ -13,6 +10,9 @@ async_setup_entry, ) from custom_components.integration_blueprint.const import DEFAULT_NAME, DOMAIN +from homeassistant.components.switch import SERVICE_TURN_OFF, SERVICE_TURN_ON +from homeassistant.const import ATTR_ENTITY_ID, Platform +from homeassistant.core import HomeAssistant from .const import MOCK_CONFIG