PySwitchbot 0.48.0__tar.gz → 0.48.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.48.0 → pyswitchbot-0.48.1}/PKG-INFO +1 -1
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/PySwitchbot.egg-info/PKG-INFO +1 -1
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/setup.py +1 -1
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/adv_parser.py +2 -2
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/adv_parsers/lock.py +24 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/LICENSE +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/MANIFEST.in +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/PySwitchbot.egg-info/SOURCES.txt +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/PySwitchbot.egg-info/dependency_links.txt +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/PySwitchbot.egg-info/requires.txt +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/PySwitchbot.egg-info/top_level.txt +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/README.md +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/setup.cfg +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/__init__.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/adv_parsers/__init__.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/adv_parsers/blind_tilt.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/adv_parsers/bot.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/adv_parsers/bulb.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/adv_parsers/ceiling_light.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/adv_parsers/contact.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/adv_parsers/curtain.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/adv_parsers/hub2.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/adv_parsers/humidifier.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/adv_parsers/light_strip.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/adv_parsers/meter.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/adv_parsers/motion.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/adv_parsers/plug.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/api_config.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/const.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/devices/__init__.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/devices/base_cover.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/devices/base_light.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/devices/blind_tilt.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/devices/bot.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/devices/bulb.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/devices/ceiling_light.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/devices/contact.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/devices/curtain.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/devices/device.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/devices/humidifier.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/devices/light_strip.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/devices/lock.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/devices/meter.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/devices/motion.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/devices/plug.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/discovery.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/enum.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/switchbot/models.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/tests/test_adv_parser.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/tests/test_base_cover.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/tests/test_blind_tilt.py +0 -0
- {pyswitchbot-0.48.0 → pyswitchbot-0.48.1}/tests/test_curtain.py +0 -0
|
@@ -19,7 +19,7 @@ from .adv_parsers.curtain import process_wocurtain
|
|
|
19
19
|
from .adv_parsers.hub2 import process_wohub2
|
|
20
20
|
from .adv_parsers.humidifier import process_wohumidifier
|
|
21
21
|
from .adv_parsers.light_strip import process_wostrip
|
|
22
|
-
from .adv_parsers.lock import process_wolock
|
|
22
|
+
from .adv_parsers.lock import process_wolock, process_wolock_pro
|
|
23
23
|
from .adv_parsers.meter import process_wosensorth
|
|
24
24
|
from .adv_parsers.motion import process_wopresence
|
|
25
25
|
from .adv_parsers.plug import process_woplugmini
|
|
@@ -153,7 +153,7 @@ SUPPORTED_TYPES: dict[str, SwitchbotSupportedType] = {
|
|
|
153
153
|
"$": {
|
|
154
154
|
"modelName": SwitchbotModel.LOCK_PRO,
|
|
155
155
|
"modelFriendlyName": "Lock Pro",
|
|
156
|
-
"func":
|
|
156
|
+
"func": process_wolock_pro,
|
|
157
157
|
"manufacturer_id": 2409,
|
|
158
158
|
},
|
|
159
159
|
"x": {
|
|
@@ -29,3 +29,27 @@ def process_wolock(data: bytes | None, mfr_data: bytes | None) -> dict[str, bool
|
|
|
29
29
|
"auto_lock_paused": bool(mfr_data[8] & 0b00000010),
|
|
30
30
|
"night_latch": bool(mfr_data[9] & 0b00000001) if len(mfr_data) > 9 else False,
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def process_wolock_pro(
|
|
35
|
+
data: bytes | None, mfr_data: bytes | None
|
|
36
|
+
) -> dict[str, bool | int]:
|
|
37
|
+
_LOGGER.debug("mfr_data: %s", mfr_data.hex())
|
|
38
|
+
if data:
|
|
39
|
+
_LOGGER.debug("data: %s", data.hex())
|
|
40
|
+
|
|
41
|
+
res = {
|
|
42
|
+
"battery": data[2] & 0b01111111 if data else None,
|
|
43
|
+
"calibration": bool(mfr_data[7] & 0b10000000),
|
|
44
|
+
"status": LockStatus((mfr_data[7] & 0b00111000) >> 3),
|
|
45
|
+
"door_open": bool(mfr_data[8] & 0b01100000),
|
|
46
|
+
# Double lock mode is not supported on Lock Pro
|
|
47
|
+
"update_from_secondary_lock": False,
|
|
48
|
+
"double_lock_mode": False,
|
|
49
|
+
"unclosed_alarm": bool(mfr_data[11] & 0b10000000),
|
|
50
|
+
"unlocked_alarm": bool(mfr_data[11] & 0b01000000),
|
|
51
|
+
"auto_lock_paused": bool(mfr_data[8] & 0b100000),
|
|
52
|
+
"night_latch": bool(mfr_data[9] & 0b00000001),
|
|
53
|
+
}
|
|
54
|
+
_LOGGER.debug(res)
|
|
55
|
+
return res
|
|
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
|