File: gatewaydevice.py

package info (click to toggle)
python-miio 0.5.12-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,888 kB
  • sloc: python: 23,425; makefile: 9
file content (31 lines) | stat: -rw-r--r-- 731 bytes parent folder | download | duplicates (2)
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
"""Xiaomi Gateway device base class."""

import logging
from typing import TYPE_CHECKING, List

from ..exceptions import DeviceException

_LOGGER = logging.getLogger(__name__)

# Necessary due to circular deps
if TYPE_CHECKING:
    from .gateway import Gateway


class GatewayDevice:
    """GatewayDevice class Specifies the init method for all gateway device
    functionalities."""

    _supported_models = ["dummy.device"]

    def __init__(
        self,
        parent: "Gateway" = None,
    ) -> None:
        if parent is None:
            raise DeviceException(
                "This should never be initialized without gateway object."
            )

        self._gateway = parent
        self._event_ids: List[str] = []