File: __init__.py

package info (click to toggle)
python-xknx 3.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,012 kB
  • sloc: python: 39,710; javascript: 8,556; makefile: 27; sh: 12
file content (34 lines) | stat: -rw-r--r-- 848 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""Types used by XKNX."""

from collections.abc import Callable
import sys
from typing import TYPE_CHECKING, TypedDict, TypeVar

if sys.version_info >= (3, 11):
    from typing import Self as Self
else:
    from typing_extensions import Self as Self

if TYPE_CHECKING:
    from xknx.core.connection_manager import XknxConnectionState
    from xknx.devices import Device
    from xknx.telegram import Telegram

CallbackType = Callable[[], None]

ConnectionChangeCallbackType = Callable[["XknxConnectionState"], None]

DeviceT = TypeVar("DeviceT", bound="Device")
DeviceCallbackType = Callable[[DeviceT], None]

TelegramCallbackType = Callable[["Telegram"], None]


class DPTMainSubDict(TypedDict):
    """DPT type dictionary in accordance to xknxproject DPTType data."""

    main: int
    sub: int | None


DPTParsable = str | int | DPTMainSubDict