Skip to content

Commit

Permalink
Fix incorrect type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Darsstar committed Apr 11, 2024
1 parent 926633a commit 708efaf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions solax/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
from asyncio import Future, Task
from collections import defaultdict
from typing import Dict, Literal, Optional, Sequence, Set, TypedDict, Union, cast
from typing import Dict, Literal, Optional, Sequence, Set, Type, TypedDict, Union, cast

from async_timeout import timeout

Expand All @@ -23,15 +23,19 @@
from typing_extensions import Unpack

# registry of inverters
REGISTRY = {ep.load() for ep in entry_points(group="solax.inverter")}
REGISTRY: Set[Type[Inverter]] = {
ep.load()
for ep in entry_points(group="solax.inverter")
if issubclass(ep.load(), Inverter)
}

logging.basicConfig(level=logging.INFO)


class DiscoveryKeywords(TypedDict, total=False):
timeout: Optional[float]
inverters: Sequence[Inverter]
return_when: Union[Literal["ALL_COMPLETED"], Literal["FIRST_COMPLETED"]]
inverters: Sequence[Type[Inverter]]
return_when: Literal["ALL_COMPLETED", "FIRST_COMPLETED"]


if sys.version_info >= (3, 9):
Expand Down

0 comments on commit 708efaf

Please sign in to comment.