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 May 4, 2024
1 parent 68c0e90 commit d0e57d3
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, Sequence, Set, TypedDict, Union, cast
from typing import Dict, Literal, Sequence, Set, Type, TypedDict, Union, cast

from solax.inverter import Inverter
from solax.inverter_http_client import InverterHttpClient
Expand All @@ -21,14 +21,18 @@
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):
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 d0e57d3

Please sign in to comment.