Skip to content

Commit cd3f729

Browse files
authored
Fix air purifier command (#335)
1 parent 09e7d5e commit cd3f729

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

switchbot/const/air_purifier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ class AirPurifierMode(Enum):
88
LEVEL_2 = 2
99
LEVEL_3 = 3
1010
AUTO = 4
11-
PET = 5
12-
SLEEP = 6
11+
SLEEP = 5
12+
PET = 6
1313

1414
@classmethod
1515
def get_modes(cls) -> list[str]:

switchbot/devices/air_purifier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
AirPurifierMode.LEVEL_2.name.lower(): f"{COMMAND_HEAD}01010132",
2929
AirPurifierMode.LEVEL_3.name.lower(): f"{COMMAND_HEAD}01010164",
3030
AirPurifierMode.AUTO.name.lower(): f"{COMMAND_HEAD}01010200",
31-
AirPurifierMode.PET.name.lower(): f"{COMMAND_HEAD}01010300",
32-
AirPurifierMode.SLEEP.name.lower(): f"{COMMAND_HEAD}01010400",
31+
AirPurifierMode.SLEEP.name.lower(): f"{COMMAND_HEAD}01010300",
32+
AirPurifierMode.PET.name.lower(): f"{COMMAND_HEAD}01010400",
3333
}
3434
DEVICE_GET_BASIC_SETTINGS_KEY = "570f4d81"
3535

tests/test_adv_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2692,7 +2692,7 @@ def test_s10_with_empty_data() -> None:
26922692
b"+\x00\x00\x15\x04\x00",
26932693
{
26942694
"isOn": True,
2695-
"mode": "pet",
2695+
"mode": "sleep",
26962696
"isAqiValid": False,
26972697
"child_lock": False,
26982698
"speed": 100,

tests/test_air_purifier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ async def test__get_basic_info(rawAdvData, model, response, expected):
171171
bytearray(
172172
b"\x01\xa8\xec\x8c\x08\x00\xb2\x01\x96\x00\x00\x00\xf0\x00\x00\x17"
173173
),
174-
[True, 2, "sleep", True, False, "excellent", 50, 240, 2.3],
174+
[True, 2, "pet", True, False, "excellent", 50, 240, 2.3],
175175
),
176176
],
177177
)
@@ -226,6 +226,6 @@ def test_get_modes():
226226
"level_2",
227227
"level_3",
228228
"auto",
229-
"pet",
230229
"sleep",
230+
"pet",
231231
]

0 commit comments

Comments
 (0)