11"""Enums for gateway types and related helpers."""
22
3- import logging
43from enum import IntEnum , StrEnum , unique
54
6- _LOGGER = logging . getLogger ( __name__ )
5+ from pyoverkiz . enums . base import UnknownEnumMixin
76
87
98@unique
10- class GatewayType (IntEnum ):
9+ class GatewayType (UnknownEnumMixin , IntEnum ):
1110 """Enumeration of known gateway types returned by Overkiz."""
1211
1312 UNKNOWN = - 1
@@ -63,11 +62,6 @@ class GatewayType(IntEnum):
6362 TAHOMA_SWITCH_CH = 126
6463 TAHOMA_SWITCH_SC = 128
6564
66- @classmethod
67- def _missing_ (cls , value ): # type: ignore
68- _LOGGER .warning (f"Unsupported value { value } has been returned for { cls } " )
69- return cls .UNKNOWN
70-
7165 @property
7266 def beautify_name (self ) -> str :
7367 """Return a human friendly name for the gateway type."""
@@ -78,7 +72,7 @@ def beautify_name(self) -> str:
7872
7973
8074@unique
81- class GatewaySubType (IntEnum ):
75+ class GatewaySubType (UnknownEnumMixin , IntEnum ):
8276 """Sub-type enumeration for gateways to identify specific models/variants."""
8377
8478 UNKNOWN = - 1
@@ -100,11 +94,6 @@ class GatewaySubType(IntEnum):
10094 TAHOMA_SECURITY_PRO = 16
10195 # TAHOMA_BOX_C_IO = 12 # Note: This is likely 17, but tahomalink.com lists it as 12
10296
103- @classmethod
104- def _missing_ (cls , value ): # type: ignore
105- _LOGGER .warning (f"Unsupported value { value } has been returned for { cls } " )
106- return cls .UNKNOWN
107-
10897 @property
10998 def beautify_name (self ) -> str :
11099 """Return a human friendly name for the gateway sub-type."""
0 commit comments