Skip to content

Commit

Permalink
Mark enums unique
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdwetering committed Oct 3, 2023
1 parent 0aaa0d7 commit f932803
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ynca/constants.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Misc constants"""
import logging
from enum import Enum
from enum import Enum, unique

logger = logging.getLogger(__name__)

MIN_VOLUME = -80.5 # Minimum volume value for receivers


@unique
class Subunit(str, Enum):
"""Known Subunits in YNCA"""

Expand Down
28 changes: 25 additions & 3 deletions ynca/enums.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""Enums used for mapping YNCA values"""

import logging
from enum import Enum
from enum import Enum, unique

logger = logging.getLogger(__name__)

UNKNOWN_STRING = "< UNKNOWN >"


@unique
class AdaptiveDrc(str, Enum):
OFF = "Off"
AUTO = "Auto"
Expand All @@ -21,6 +21,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class Avail(str, Enum):
NOT_CONNECTED = "Not Connected"
NOT_READY = "Not Ready"
Expand All @@ -35,6 +36,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class BandDab(str, Enum):
DAB = "DAB"
FM = "FM"
Expand All @@ -48,6 +50,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class BandTun(str, Enum):
AM = "AM"
FM = "FM"
Expand All @@ -61,6 +64,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class Enhancer(str, Enum):
ON = "On"
OFF = "Off"
Expand All @@ -74,6 +78,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class HdmiOut(str, Enum):
OFF = "Off"
OUT1 = "OUT1"
Expand All @@ -89,6 +94,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class HdmiOutOnOff(Enum):
ON = "On"
OFF = "Off"
Expand All @@ -102,6 +108,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class InitVolLvl(str, Enum):
MUTE = "Mute"
OFF = "Off"
Expand All @@ -116,6 +123,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class InitVolMode(str, Enum):
ON = "On"
OFF = "Off"
Expand All @@ -129,6 +137,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class Input(Enum):
# Inputs with connectors on the receiver
AUDIO1 = "AUDIO1"
Expand Down Expand Up @@ -182,6 +191,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class Mute(str, Enum):
ON = "On"
ATT_MINUS_20 = "Att -20 dB"
Expand All @@ -196,7 +206,7 @@ def _missing_(cls, value):
UNKNOWN = UNKNOWN_STRING
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class Party(Enum):
ON = "On"
OFF = "Off"
Expand All @@ -210,6 +220,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class PartyMute(Enum):
ON = "On"
OFF = "Off"
Expand All @@ -223,6 +234,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class Playback(str, Enum):
STOP = "Stop"
PAUSE = "Pause"
Expand All @@ -239,6 +251,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class PlaybackInfo(str, Enum):
STOP = "Stop"
PAUSE = "Pause"
Expand All @@ -253,6 +266,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class PureDirMode(Enum):
ON = "On"
OFF = "Off"
Expand All @@ -266,6 +280,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class Pwr(Enum):
ON = "On"
STANDBY = "Standby"
Expand All @@ -279,6 +294,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class Repeat(str, Enum):
OFF = "Off"
SINGLE = "Single"
Expand All @@ -293,6 +309,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class Shuffle(str, Enum):
ON = "On"
OFF = "Off"
Expand All @@ -306,6 +323,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class Sleep(str, Enum):
OFF = "Off"
THIRTY_MIN = "30 min"
Expand All @@ -322,6 +340,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class SoundPrg(str, Enum):
HALL_IN_MUNICH = "Hall in Munich"
HALL_IN_VIENNA = "Hall in Vienna"
Expand Down Expand Up @@ -362,6 +381,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class Straight(Enum):
ON = "On"
OFF = "Off"
Expand All @@ -375,6 +395,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class ThreeDeeCinema(str, Enum):
OFF = "Off"
AUTO = "Auto"
Expand All @@ -388,6 +409,7 @@ def _missing_(cls, value):
"""Unknown values in the enum are mapped to UNKNOWN"""


@unique
class TwoChDecoder(str, Enum):
# Older models support Dolby Prologic and DTS:Neo settings
DolbyPl = "Dolby PL"
Expand Down

0 comments on commit f932803

Please sign in to comment.