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.
Files changed (86) hide show
  1. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/PKG-INFO +1 -1
  2. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/PySwitchbot.egg-info/PKG-INFO +1 -1
  3. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/setup.py +1 -1
  4. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/blind_tilt.py +1 -1
  5. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_adv_parser.py +86 -0
  6. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/LICENSE +0 -0
  7. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/MANIFEST.in +0 -0
  8. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/PySwitchbot.egg-info/SOURCES.txt +0 -0
  9. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/PySwitchbot.egg-info/dependency_links.txt +0 -0
  10. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/PySwitchbot.egg-info/requires.txt +0 -0
  11. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/PySwitchbot.egg-info/top_level.txt +0 -0
  12. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/README.md +0 -0
  13. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/pyproject.toml +0 -0
  14. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/setup.cfg +0 -0
  15. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/__init__.py +0 -0
  16. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parser.py +0 -0
  17. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/__init__.py +0 -0
  18. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/air_purifier.py +0 -0
  19. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/bot.py +0 -0
  20. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/bulb.py +0 -0
  21. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/ceiling_light.py +0 -0
  22. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/contact.py +0 -0
  23. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/curtain.py +0 -0
  24. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/fan.py +0 -0
  25. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/hub2.py +0 -0
  26. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/hub3.py +0 -0
  27. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/hubmini_matter.py +0 -0
  28. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/humidifier.py +0 -0
  29. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/keypad.py +0 -0
  30. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/leak.py +0 -0
  31. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/light_strip.py +0 -0
  32. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/lock.py +0 -0
  33. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/meter.py +0 -0
  34. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/motion.py +0 -0
  35. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/plug.py +0 -0
  36. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/relay_switch.py +0 -0
  37. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/remote.py +0 -0
  38. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/roller_shade.py +0 -0
  39. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/adv_parsers/vacuum.py +0 -0
  40. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/api_config.py +0 -0
  41. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/const/__init__.py +0 -0
  42. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/const/air_purifier.py +0 -0
  43. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/const/evaporative_humidifier.py +0 -0
  44. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/const/fan.py +0 -0
  45. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/const/hub2.py +0 -0
  46. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/const/hub3.py +0 -0
  47. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/const/lock.py +0 -0
  48. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/__init__.py +0 -0
  49. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/air_purifier.py +0 -0
  50. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/base_cover.py +0 -0
  51. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/base_light.py +0 -0
  52. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/blind_tilt.py +0 -0
  53. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/bot.py +0 -0
  54. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/bulb.py +0 -0
  55. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/ceiling_light.py +0 -0
  56. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/contact.py +0 -0
  57. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/curtain.py +0 -0
  58. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/device.py +0 -0
  59. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/evaporative_humidifier.py +0 -0
  60. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/fan.py +0 -0
  61. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/humidifier.py +0 -0
  62. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/keypad.py +0 -0
  63. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/light_strip.py +0 -0
  64. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/lock.py +0 -0
  65. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/meter.py +0 -0
  66. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/motion.py +0 -0
  67. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/plug.py +0 -0
  68. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/relay_switch.py +0 -0
  69. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/roller_shade.py +0 -0
  70. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/devices/vacuum.py +0 -0
  71. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/discovery.py +0 -0
  72. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/enum.py +0 -0
  73. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/helpers.py +0 -0
  74. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/switchbot/models.py +0 -0
  75. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_air_purifier.py +0 -0
  76. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_base_cover.py +0 -0
  77. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_blind_tilt.py +0 -0
  78. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_curtain.py +0 -0
  79. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_evaporative_humidifier.py +0 -0
  80. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_fan.py +0 -0
  81. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_hub2.py +0 -0
  82. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_hub3.py +0 -0
  83. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_lock.py +0 -0
  84. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_relay_switch.py +0 -0
  85. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_roller_shade.py +0 -0
  86. {pyswitchbot-0.64.0 → pyswitchbot-0.64.1}/tests/test_vacuum.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySwitchbot
3
- Version: 0.64.0
3
+ Version: 0.64.1
4
4
  Summary: A library to communicate with Switchbot
5
5
  Home-page: https://github.com/sblibs/pySwitchbot/
6
6
  Author: Daniel Hjelseth Hoyer
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySwitchbot
3
- Version: 0.64.0
3
+ Version: 0.64.1
4
4
  Summary: A library to communicate with Switchbot
5
5
  Home-page: https://github.com/sblibs/pySwitchbot/
6
6
  Author: Daniel Hjelseth Hoyer
@@ -20,7 +20,7 @@ setup(
20
20
  "cryptography>=39.0.0",
21
21
  "pyOpenSSL>=23.0.0",
22
22
  ],
23
- version="0.64.0",
23
+ version="0.64.1",
24
24
  description="A library to communicate with Switchbot",
25
25
  long_description=long_description,
26
26
  long_description_content_type="text/markdown",
@@ -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[1] >> 4) & 0b00001111
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