diff --git a/custom_components/unifi_voucher/api.py b/custom_components/unifi_voucher/api.py index 19cb4bf..4c05e8a 100644 --- a/custom_components/unifi_voucher/api.py +++ b/custom_components/unifi_voucher/api.py @@ -2,29 +2,21 @@ from __future__ import annotations import asyncio -import ssl from dataclasses import dataclass from aiohttp import CookieJar import aiounifi -from aiounifi.interfaces.api_handlers import ItemEvent -from aiounifi.interfaces.sites import Sites from aiounifi.models.configuration import Configuration -from aiounifi.models.api import ApiItem, ApiRequest +from aiounifi.models.api import ApiRequest from homeassistant.core import ( callback, HomeAssistant, ) from homeassistant.helpers import aiohttp_client -from homeassistant.helpers.dispatcher import ( - async_dispatcher_connect, - async_dispatcher_send, -) from .const import ( LOGGER, - DOMAIN, ) RETRY_TIMER = 15 @@ -52,7 +44,7 @@ class UnifiVoucherListRequest(ApiRequest): @classmethod def create( cls - ) -> Self: + ) -> self: """Create voucher list request.""" return cls( method="get", @@ -73,7 +65,7 @@ def create( down_bandwidth: int | None = None, byte_quota: int | None = None, note: str | None = None, - ) -> Self: + ) -> self: """ Create voucher create request. @@ -214,6 +206,9 @@ async def check_api_user( ) raise UnifiVoucherApiAuthenticationError from err except aiounifi.AiounifiException as err: - LOGGER.exception("Unknown UniFi Network communication error occurred: %s", err) + LOGGER.exception( + "Unknown UniFi Network communication error occurred: %s", + err, + ) raise UnifiVoucherApiError from err return False diff --git a/custom_components/unifi_voucher/config_flow.py b/custom_components/unifi_voucher/config_flow.py index bfcc24e..c47a4fe 100644 --- a/custom_components/unifi_voucher/config_flow.py +++ b/custom_components/unifi_voucher/config_flow.py @@ -1,9 +1,6 @@ """Adds config flow for UniFi Hotspot Manager.""" from __future__ import annotations -from aiounifi.interfaces.sites import Sites -from aiounifi.models.site import Site - from homeassistant.core import ( callback, HomeAssistant, diff --git a/custom_components/unifi_voucher/coordinator.py b/custom_components/unifi_voucher/coordinator.py index aa1c687..8f5c1c9 100644 --- a/custom_components/unifi_voucher/coordinator.py +++ b/custom_components/unifi_voucher/coordinator.py @@ -10,8 +10,6 @@ CONF_PORT, CONF_USERNAME, CONF_VERIFY_SSL, - ATTR_STATE, - ATTR_TEMPERATURE, ) from homeassistant.config_entries import ConfigEntry from homeassistant.helpers.update_coordinator import (