PySwitchbot 0.60.0__tar.gz → 0.60.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/PKG-INFO +1 -1
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/PySwitchbot.egg-info/PKG-INFO +1 -1
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/setup.py +1 -1
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/fan.py +1 -1
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/const/fan.py +1 -1
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/fan.py +5 -5
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_adv_parser.py +2 -2
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_fan.py +6 -6
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/LICENSE +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/MANIFEST.in +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/PySwitchbot.egg-info/SOURCES.txt +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/PySwitchbot.egg-info/dependency_links.txt +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/PySwitchbot.egg-info/requires.txt +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/PySwitchbot.egg-info/top_level.txt +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/README.md +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/pyproject.toml +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/setup.cfg +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/__init__.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parser.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/__init__.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/blind_tilt.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/bot.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/bulb.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/ceiling_light.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/contact.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/curtain.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/hub2.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/hubmini_matter.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/humidifier.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/keypad.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/leak.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/light_strip.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/lock.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/meter.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/motion.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/plug.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/relay_switch.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/remote.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/roller_shade.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/api_config.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/const/__init__.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/const/evaporative_humidifier.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/const/hub2.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/const/lock.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/__init__.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/base_cover.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/base_light.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/blind_tilt.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/bot.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/bulb.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/ceiling_light.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/contact.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/curtain.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/device.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/evaporative_humidifier.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/humidifier.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/keypad.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/light_strip.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/lock.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/meter.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/motion.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/plug.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/relay_switch.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/roller_shade.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/discovery.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/enum.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/helpers.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/models.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_base_cover.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_blind_tilt.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_curtain.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_evaporative_humidifier.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_hub2.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_relay_switch.py +0 -0
- {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_roller_shade.py +0 -0
|
@@ -15,7 +15,7 @@ def process_fan(data: bytes | None, mfr_data: bytes | None) -> dict[str, bool |
|
|
|
15
15
|
_seq_num = device_data[0]
|
|
16
16
|
_isOn = bool(device_data[1] & 0b10000000)
|
|
17
17
|
_mode = (device_data[1] & 0b01110000) >> 4
|
|
18
|
-
_mode = FanMode(_mode).name if 1 <= _mode <= 4 else None
|
|
18
|
+
_mode = FanMode(_mode).name.lower() if 1 <= _mode <= 4 else None
|
|
19
19
|
_nightLight = (device_data[1] & 0b00001100) >> 2
|
|
20
20
|
_oscillate_left_and_right = bool(device_data[1] & 0b00000010)
|
|
21
21
|
_oscillate_up_and_down = bool(device_data[1] & 0b00000001)
|
|
@@ -21,10 +21,10 @@ COMMAND_TURN_OFF = f"{COMMAND_HEAD}0102"
|
|
|
21
21
|
COMMAND_START_OSCILLATION = f"{COMMAND_HEAD}020101ff"
|
|
22
22
|
COMMAND_STOP_OSCILLATION = f"{COMMAND_HEAD}020102ff"
|
|
23
23
|
COMMAND_SET_MODE = {
|
|
24
|
-
FanMode.NORMAL.name: f"{COMMAND_HEAD}030101ff",
|
|
25
|
-
FanMode.NATURAL.name: f"{COMMAND_HEAD}030102ff",
|
|
26
|
-
FanMode.SLEEP.name: f"{COMMAND_HEAD}030103",
|
|
27
|
-
FanMode.BABY.name: f"{COMMAND_HEAD}030104",
|
|
24
|
+
FanMode.NORMAL.name.lower(): f"{COMMAND_HEAD}030101ff",
|
|
25
|
+
FanMode.NATURAL.name.lower(): f"{COMMAND_HEAD}030102ff",
|
|
26
|
+
FanMode.SLEEP.name.lower(): f"{COMMAND_HEAD}030103",
|
|
27
|
+
FanMode.BABY.name.lower(): f"{COMMAND_HEAD}030104",
|
|
28
28
|
}
|
|
29
29
|
COMMAND_SET_PERCENTAGE = f"{COMMAND_HEAD}0302" # +speed
|
|
30
30
|
COMMAND_GET_BASIC_INFO = "570f428102"
|
|
@@ -48,7 +48,7 @@ class SwitchbotFan(SwitchbotSequenceDevice):
|
|
|
48
48
|
isOn = bool(_data[3] & 0b10000000)
|
|
49
49
|
oscillating = bool(_data[3] & 0b01100000)
|
|
50
50
|
_mode = _data[8] & 0b00000111
|
|
51
|
-
mode = FanMode(_mode).name if 1 <= _mode <= 4 else None
|
|
51
|
+
mode = FanMode(_mode).name.lower() if 1 <= _mode <= 4 else None
|
|
52
52
|
speed = _data[9]
|
|
53
53
|
firmware = _data1[2] / 10.0
|
|
54
54
|
|
|
@@ -2123,7 +2123,7 @@ def test_circulator_fan_active() -> None:
|
|
|
2123
2123
|
"data": {
|
|
2124
2124
|
"sequence_number": 126,
|
|
2125
2125
|
"isOn": False,
|
|
2126
|
-
"mode": "
|
|
2126
|
+
"mode": "baby",
|
|
2127
2127
|
"nightLight": 3,
|
|
2128
2128
|
"oscillating": False,
|
|
2129
2129
|
"battery": 82,
|
|
@@ -2157,7 +2157,7 @@ def test_circulator_fan_passive() -> None:
|
|
|
2157
2157
|
"data": {
|
|
2158
2158
|
"sequence_number": 126,
|
|
2159
2159
|
"isOn": False,
|
|
2160
|
-
"mode": "
|
|
2160
|
+
"mode": "baby",
|
|
2161
2161
|
"nightLight": 3,
|
|
2162
2162
|
"oscillating": False,
|
|
2163
2163
|
"battery": 82,
|
|
@@ -89,12 +89,12 @@ async def test_get_basic_info_returns_none(basic_info, firmware_info):
|
|
|
89
89
|
(
|
|
90
90
|
bytearray(b"\x01\x02W\x82g\xf5\xde4\x01=dPP\x03\x14P\x00\x00\x00\x00"),
|
|
91
91
|
bytearray(b"\x01W\x0b\x17\x01"),
|
|
92
|
-
[87, True, False, "
|
|
92
|
+
[87, True, False, "normal", 61, 1.1],
|
|
93
93
|
),
|
|
94
94
|
(
|
|
95
95
|
bytearray(b"\x01\x02U\xc2g\xf5\xde4\x04+dPP\x03\x14P\x00\x00\x00\x00"),
|
|
96
96
|
bytearray(b"\x01U\x0b\x17\x01"),
|
|
97
|
-
[85, True, True, "
|
|
97
|
+
[85, True, True, "baby", 43, 1.1],
|
|
98
98
|
),
|
|
99
99
|
],
|
|
100
100
|
)
|
|
@@ -120,9 +120,9 @@ async def test_get_basic_info(basic_info, firmware_info, result):
|
|
|
120
120
|
|
|
121
121
|
@pytest.mark.asyncio
|
|
122
122
|
async def test_set_preset_mode():
|
|
123
|
-
fan_device = create_device_for_command_testing({"mode": "
|
|
124
|
-
await fan_device.set_preset_mode("
|
|
125
|
-
assert fan_device.get_current_mode() == "
|
|
123
|
+
fan_device = create_device_for_command_testing({"mode": "baby"})
|
|
124
|
+
await fan_device.set_preset_mode("baby")
|
|
125
|
+
assert fan_device.get_current_mode() == "baby"
|
|
126
126
|
|
|
127
127
|
|
|
128
128
|
@pytest.mark.asyncio
|
|
@@ -169,4 +169,4 @@ async def test_turn_off():
|
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
def test_get_modes():
|
|
172
|
-
assert FanMode.get_modes() == ["
|
|
172
|
+
assert FanMode.get_modes() == ["normal", "natural", "sleep", "baby"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|