Skip to content

Commit

Permalink
mypy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Dos Moonen committed Jun 20, 2023
1 parent 69faf66 commit eda9478
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions solax/discovery.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import asyncio
from typing import Type
from typing import Type, List

from solax.http_client import all_variations
from solax.inverter import Inverter, InverterError
Expand All @@ -14,7 +14,7 @@
XHybrid,
)

REGISTRY: list[Type[Inverter]] = [
REGISTRY: List[Type[Inverter]] = [
XHybrid,
X3,
X3V34,
Expand All @@ -34,7 +34,7 @@ class DiscoveryError(Exception):


async def discover(host, port, pwd="") -> Inverter:
failures: list = []
failures: List = []
clients = all_variations(host, port, pwd)
pending = set()

Expand Down
8 changes: 4 additions & 4 deletions solax/inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@


class InverterRawResponse(TypedDict):
Data: list[float]
Data: List[float]
sn: Optional[str]
SN: Optional[str]
version: Optional[str]
ver: Optional[str]
type: Union[int, str]
Information: Optional[list[Any]]
Information: Optional[List[Any]]


@dataclass
class InverterResponse:
data: dict[str, float]
data: Dict[str, float]
serial_number: str
version: str
type: Union[int, str]
Expand Down Expand Up @@ -102,7 +102,7 @@ async def get_data(self) -> InverterResponse:

def map_response_v2(
self, inverter_response: InverterRawResponse
) -> dict[str, float]:
) -> Dict[str, float]:
data = inverter_response["Data"]
highest_index = max(
(max(v.indexes) for v in self.inverter_definition().mapping.values())
Expand Down

0 comments on commit eda9478

Please sign in to comment.