Skip to content

Commit f8090a8

Browse files
authored
Align relay switch constants to match existing codebase conventions (#266)
1 parent 8f87eac commit f8090a8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

switchbot/adv_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,13 @@ class SwitchbotSupportedType(TypedDict):
185185
"manufacturer_id": 2409,
186186
},
187187
"<": {
188-
"modelName": SwitchbotModel.RelaySwitch1PM,
188+
"modelName": SwitchbotModel.RELAY_SWITCH_1PM,
189189
"modelFriendlyName": "Relay Switch 1PM",
190190
"func": process_worelay_switch_1pm,
191191
"manufacturer_id": 2409,
192192
},
193193
";": {
194-
"modelName": SwitchbotModel.RelaySwitch1Plus,
194+
"modelName": SwitchbotModel.RELAY_SWITCH_1_PLUS,
195195
"modelFriendlyName": "Relay Switch 1",
196196
"func": process_worelay_switch_1plus,
197197
"manufacturer_id": 2409,

switchbot/const.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ class SwitchbotModel(StrEnum):
5454
BLIND_TILT = "WoBlindTilt"
5555
HUB2 = "WoHub2"
5656
KEYPAD = "WoKeypad"
57-
RelaySwitch1PM = "Relay Switch 1PM"
58-
RelaySwitch1Plus = "Relay Switch 1"
57+
RELAY_SWITCH_1PM = "Relay Switch 1PM"
58+
RELAY_SWITCH_1_PLUS = "Relay Switch 1"
5959

6060

6161
class LockStatus(Enum):

switchbot/devices/relay_switch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(
2525
key_id: str,
2626
encryption_key: str,
2727
interface: int = 0,
28-
model: SwitchbotModel = SwitchbotModel.RelaySwitch1PM,
28+
model: SwitchbotModel = SwitchbotModel.RELAY_SWITCH_1PM,
2929
**kwargs: Any,
3030
) -> None:
3131
if len(key_id) == 0:

0 commit comments

Comments
 (0)