File: device_type.py

package info (click to toggle)
python-bond-async 0.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 204 kB
  • sloc: python: 1,537; makefile: 4
file content (54 lines) | stat: -rw-r--r-- 1,697 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"""Bond Device type enumeration."""


class DeviceType:
    """Bond Device type enumeration."""

    CEILING_FAN = "CF"
    MOTORIZED_SHADES = "MS"
    FIREPLACE = "FP"
    AIR_CONDITIONER = "AC"
    GARAGE_DOOR = "GD"
    BIDET = "BD"
    LIGHT = "LT"
    GENERIC_DEVICE = "GX"

    @staticmethod
    def is_fan(device_type: str) -> bool:
        """Checks if specified device type is a fan."""
        return device_type == DeviceType.CEILING_FAN

    @staticmethod
    def is_shades(device_type: str) -> bool:
        """Checks if specified device type is shades."""
        return device_type == DeviceType.MOTORIZED_SHADES

    @staticmethod
    def is_fireplace(device_type: str) -> bool:
        """Checks if specified device type is fireplace."""
        return device_type == DeviceType.FIREPLACE

    @staticmethod
    def is_air_conditioner(device_type: str) -> bool:
        """Checks if specified device type is air conditioner."""
        return device_type == DeviceType.AIR_CONDITIONER

    @staticmethod
    def is_garage_door(device_type: str) -> bool:
        """Checks if specified device type is garage door."""
        return device_type == DeviceType.GARAGE_DOOR

    @staticmethod
    def is_bidet(device_type: str) -> bool:
        """Checks if specified device type is bidet."""
        return device_type == DeviceType.BIDET

    @staticmethod
    def is_light(device_type: str) -> bool:
        """Checks if specified device type is light."""
        return device_type == DeviceType.LIGHT

    @staticmethod
    def is_generic(device_type: str) -> bool:
        """Checks if specified device type is generic."""
        return device_type == DeviceType.GENERIC_DEVICE