Browse Source

Align relay switch constants to match existing codebase conventions (#266)

J. Nick Koston 3 months ago
parent
commit
f8090a840f
3 changed files with 5 additions and 5 deletions
  1. 2 2
      switchbot/adv_parser.py
  2. 2 2
      switchbot/const.py
  3. 1 1
      switchbot/devices/relay_switch.py

+ 2 - 2
switchbot/adv_parser.py

@@ -185,13 +185,13 @@ SUPPORTED_TYPES: dict[str, SwitchbotSupportedType] = {
         "manufacturer_id": 2409,
     },
     "<": {
-        "modelName": SwitchbotModel.RelaySwitch1PM,
+        "modelName": SwitchbotModel.RELAY_SWITCH_1PM,
         "modelFriendlyName": "Relay Switch 1PM",
         "func": process_worelay_switch_1pm,
         "manufacturer_id": 2409,
     },
     ";": {
-        "modelName": SwitchbotModel.RelaySwitch1Plus,
+        "modelName": SwitchbotModel.RELAY_SWITCH_1_PLUS,
         "modelFriendlyName": "Relay Switch 1",
         "func": process_worelay_switch_1plus,
         "manufacturer_id": 2409,

+ 2 - 2
switchbot/const.py

@@ -54,8 +54,8 @@ class SwitchbotModel(StrEnum):
     BLIND_TILT = "WoBlindTilt"
     HUB2 = "WoHub2"
     KEYPAD = "WoKeypad"
-    RelaySwitch1PM = "Relay Switch 1PM"
-    RelaySwitch1Plus = "Relay Switch 1"
+    RELAY_SWITCH_1PM = "Relay Switch 1PM"
+    RELAY_SWITCH_1_PLUS = "Relay Switch 1"
 
 
 class LockStatus(Enum):

+ 1 - 1
switchbot/devices/relay_switch.py

@@ -25,7 +25,7 @@ class SwitchbotRelaySwitch(SwitchbotSequenceDevice):
         key_id: str,
         encryption_key: str,
         interface: int = 0,
-        model: SwitchbotModel = SwitchbotModel.RelaySwitch1PM,
+        model: SwitchbotModel = SwitchbotModel.RELAY_SWITCH_1PM,
         **kwargs: Any,
     ) -> None:
         if len(key_id) == 0: