PySwitchbot 0.64.0__tar.gz → 0.64.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.64.0 → pyswitchbot-0.64.1}/PKG-INFO +1 -1
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/PySwitchbot.egg-info/PKG-INFO +1 -1
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/setup.py +1 -1
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/blind_tilt.py +1 -1
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_adv_parser.py +86 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/LICENSE +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/MANIFEST.in +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/PySwitchbot.egg-info/SOURCES.txt +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/PySwitchbot.egg-info/dependency_links.txt +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/PySwitchbot.egg-info/requires.txt +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/PySwitchbot.egg-info/top_level.txt +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/README.md +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/pyproject.toml +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/setup.cfg +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/__init__.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parser.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/__init__.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/air_purifier.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/bot.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/bulb.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/ceiling_light.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/contact.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/curtain.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/fan.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/hub2.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/hub3.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/hubmini_matter.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/humidifier.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/keypad.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/leak.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/light_strip.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/lock.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/meter.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/motion.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/plug.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/relay_switch.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/remote.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/roller_shade.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/vacuum.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/api_config.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/const/__init__.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/const/air_purifier.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/const/evaporative_humidifier.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/const/fan.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/const/hub2.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/const/hub3.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/const/lock.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/__init__.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/air_purifier.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/base_cover.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/base_light.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/blind_tilt.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/bot.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/bulb.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/ceiling_light.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/contact.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/curtain.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/device.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/evaporative_humidifier.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/fan.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/humidifier.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/keypad.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/light_strip.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/lock.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/meter.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/motion.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/plug.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/relay_switch.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/roller_shade.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/vacuum.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/discovery.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/enum.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/helpers.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/models.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_air_purifier.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_base_cover.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_blind_tilt.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_curtain.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_evaporative_humidifier.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_fan.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_hub2.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_hub3.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_lock.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_relay_switch.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_roller_shade.py +0 -0
- {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_vacuum.py +0 -0
|
@@ -14,7 +14,7 @@ def process_woblindtilt(
|
|
|
14
14
|
|
|
15
15
|
_tilt = max(min(device_data[2] & 0b01111111, 100), 0)
|
|
16
16
|
_in_motion = bool(device_data[2] & 0b10000000)
|
|
17
|
-
_light_level = (device_data[
|
|
17
|
+
_light_level = (device_data[3] >> 4) & 0b00001111
|
|
18
18
|
_calibrated = bool(device_data[1] & 0b00000001)
|
|
19
19
|
|
|
20
20
|
return {
|
|
@@ -3001,3 +3001,89 @@ def test_lock_with_empty_data(test_case: AdvTestCase) -> None:
|
|
|
3001
3001
|
rssi=-97,
|
|
3002
3002
|
active=True,
|
|
3003
3003
|
)
|
|
3004
|
+
|
|
3005
|
+
|
|
3006
|
+
def test_blind_tilt_active() -> None:
|
|
3007
|
+
"""Test parsing blind tilt with active data."""
|
|
3008
|
+
ble_device = generate_ble_device("aa:bb:cc:dd:ee:ff", "any")
|
|
3009
|
+
adv_data = generate_advertisement_data(
|
|
3010
|
+
manufacturer_data={2409: b"\xfc(\\6l\x7f\x0b'\x00\xa1\x84"},
|
|
3011
|
+
service_data={"0000fd3d-0000-1000-8000-00805f9b34fb": b"x\x00H"},
|
|
3012
|
+
rssi=-97,
|
|
3013
|
+
)
|
|
3014
|
+
result = parse_advertisement_data(ble_device, adv_data)
|
|
3015
|
+
assert result == SwitchBotAdvertisement(
|
|
3016
|
+
address="aa:bb:cc:dd:ee:ff",
|
|
3017
|
+
data={
|
|
3018
|
+
"rawAdvData": b"x\x00H",
|
|
3019
|
+
"data": {
|
|
3020
|
+
"sequence_number": 11,
|
|
3021
|
+
"battery": 72,
|
|
3022
|
+
"tilt": 0,
|
|
3023
|
+
"inMotion": False,
|
|
3024
|
+
"calibration": True,
|
|
3025
|
+
"lightLevel": 10,
|
|
3026
|
+
},
|
|
3027
|
+
"isEncrypted": False,
|
|
3028
|
+
"model": "x",
|
|
3029
|
+
"modelFriendlyName": "Blind Tilt",
|
|
3030
|
+
"modelName": SwitchbotModel.BLIND_TILT,
|
|
3031
|
+
},
|
|
3032
|
+
device=ble_device,
|
|
3033
|
+
rssi=-97,
|
|
3034
|
+
active=True,
|
|
3035
|
+
)
|
|
3036
|
+
|
|
3037
|
+
|
|
3038
|
+
def test_blind_tilt_passive() -> None:
|
|
3039
|
+
"""Test parsing blind tilt with passive data."""
|
|
3040
|
+
ble_device = generate_ble_device("aa:bb:cc:dd:ee:ff", "any")
|
|
3041
|
+
adv_data = generate_advertisement_data(
|
|
3042
|
+
manufacturer_data={2409: b"\xfc(\\6l\x7f\x0b'\x00\xa1\x84"},
|
|
3043
|
+
rssi=-97,
|
|
3044
|
+
)
|
|
3045
|
+
result = parse_advertisement_data(ble_device, adv_data, SwitchbotModel.BLIND_TILT)
|
|
3046
|
+
assert result == SwitchBotAdvertisement(
|
|
3047
|
+
address="aa:bb:cc:dd:ee:ff",
|
|
3048
|
+
data={
|
|
3049
|
+
"rawAdvData": None,
|
|
3050
|
+
"data": {
|
|
3051
|
+
"sequence_number": 11,
|
|
3052
|
+
"battery": None,
|
|
3053
|
+
"tilt": 0,
|
|
3054
|
+
"inMotion": False,
|
|
3055
|
+
"calibration": True,
|
|
3056
|
+
"lightLevel": 10,
|
|
3057
|
+
},
|
|
3058
|
+
"isEncrypted": False,
|
|
3059
|
+
"model": "x",
|
|
3060
|
+
"modelFriendlyName": "Blind Tilt",
|
|
3061
|
+
"modelName": SwitchbotModel.BLIND_TILT,
|
|
3062
|
+
},
|
|
3063
|
+
device=ble_device,
|
|
3064
|
+
rssi=-97,
|
|
3065
|
+
active=False,
|
|
3066
|
+
)
|
|
3067
|
+
|
|
3068
|
+
|
|
3069
|
+
def test_blind_tilt_with_empty_data() -> None:
|
|
3070
|
+
"""Test parsing blind tilt with empty data."""
|
|
3071
|
+
ble_device = generate_ble_device("aa:bb:cc:dd:ee:ff", "any")
|
|
3072
|
+
adv_data = generate_advertisement_data(
|
|
3073
|
+
manufacturer_data={2409: None},
|
|
3074
|
+
service_data={"0000fd3d-0000-1000-8000-00805f9b34fb": b"x\x00H"},
|
|
3075
|
+
rssi=-97,
|
|
3076
|
+
)
|
|
3077
|
+
result = parse_advertisement_data(ble_device, adv_data)
|
|
3078
|
+
assert result == SwitchBotAdvertisement(
|
|
3079
|
+
address="aa:bb:cc:dd:ee:ff",
|
|
3080
|
+
data={
|
|
3081
|
+
"rawAdvData": b"x\x00H",
|
|
3082
|
+
"data": {},
|
|
3083
|
+
"isEncrypted": False,
|
|
3084
|
+
"model": "x",
|
|
3085
|
+
},
|
|
3086
|
+
device=ble_device,
|
|
3087
|
+
rssi=-97,
|
|
3088
|
+
active=True,
|
|
3089
|
+
)
|
|
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
|
|
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
|