Skip to content

Commit

Permalink
mypy (remove TypeAlias)
Browse files Browse the repository at this point in the history
  • Loading branch information
zxdavb committed Jun 29, 2024
1 parent a96af10 commit 9d94953
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions custom_components/ramses_cc/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import logging
from copy import deepcopy
from datetime import timedelta
from typing import Any, Final, TypeAlias
from typing import Any, Final, NewType

import voluptuous as vol # type: ignore[import-untyped, unused-ignore]
from homeassistant.const import CONF_SCAN_INTERVAL
Expand Down Expand Up @@ -73,7 +73,7 @@
ZoneMode,
)

_SchemaT: TypeAlias = dict[str, Any]
_SchemaT = NewType("_SchemaT", dict[str, Any])

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -154,7 +154,7 @@ def normalise_config(config: _SchemaT) -> tuple[str, _SchemaT, _SchemaT]:
}

broker_keys = (CONF_SCAN_INTERVAL, CONF_ADVANCED_FEATURES, SZ_RESTORE_CACHE)
return (
return ( # type: ignore[return-value]
port_name,
{k: v for k, v in config.items() if k not in broker_keys}
| {SZ_PORT_CONFIG: port_config},
Expand Down
6 changes: 3 additions & 3 deletions tests/virtual_rf/virtual_rf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
from collections import deque
from io import FileIO
from selectors import EVENT_READ, DefaultSelector
from typing import Any, Final, TypeAlias, TypedDict
from typing import Any, Final, NewType, TypedDict

from serial import Serial, serial_for_url # type: ignore[import-untyped]

from .const import HgiFwTypes

_FD: TypeAlias = int # file descriptor
_PN: TypeAlias = str # port name
_FD = NewType("_FD", int) # file descriptor
_PN = NewType("_PN", str) # port name

# _FILEOBJ: TypeAlias = int | Any # int | HasFileno

Expand Down

0 comments on commit 9d94953

Please sign in to comment.