Fix bad typing for LogLevel (#45)

* Fix bad typing for LogLevel

* Lint
This commit is contained in:
Otto Winter 2021-06-24 09:55:35 +02:00 committed by GitHub
parent adcfe53d34
commit 86a8ab9130
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 3 deletions

View File

@ -1,6 +1,17 @@
import asyncio
import logging
from typing import Any, Awaitable, Callable, Dict, List, Optional, Tuple, Union, cast
from typing import (
TYPE_CHECKING,
Any,
Awaitable,
Callable,
Dict,
List,
Optional,
Tuple,
Union,
cast,
)
import attr
import zeroconf
@ -36,7 +47,6 @@ from aioesphomeapi.api_pb2 import ( # type: ignore
ListEntitiesServicesResponse,
ListEntitiesSwitchResponse,
ListEntitiesTextSensorResponse,
LogLevel,
SensorStateResponse,
SubscribeHomeassistantServicesRequest,
SubscribeHomeAssistantStateResponse,
@ -85,6 +95,9 @@ from aioesphomeapi.model import (
UserServiceArgType,
)
if TYPE_CHECKING:
from aioesphomeapi.api_pb2 import LogLevel # type: ignore
_LOGGER = logging.getLogger(__name__)
ExecuteServiceDataType = Dict[
@ -289,7 +302,7 @@ class APIClient:
async def subscribe_logs(
self,
on_log: Callable[[SubscribeLogsResponse], None],
log_level: Optional[LogLevel] = None,
log_level: Optional["LogLevel"] = None,
) -> None:
self._check_authenticated()