PySwitchbot 0.62.0__tar.gz → 0.62.2__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 (82) hide show
  1. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/PKG-INFO +2 -2
  2. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/PySwitchbot.egg-info/PKG-INFO +2 -2
  3. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/README.md +1 -1
  4. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/setup.py +1 -1
  5. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parser.py +4 -4
  6. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/const/__init__.py +1 -0
  7. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/const/air_purifier.py +2 -2
  8. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/air_purifier.py +2 -2
  9. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/tests/test_adv_parser.py +31 -17
  10. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/tests/test_air_purifier.py +2 -2
  11. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/LICENSE +0 -0
  12. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/MANIFEST.in +0 -0
  13. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/PySwitchbot.egg-info/SOURCES.txt +0 -0
  14. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/PySwitchbot.egg-info/dependency_links.txt +0 -0
  15. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/PySwitchbot.egg-info/requires.txt +0 -0
  16. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/PySwitchbot.egg-info/top_level.txt +0 -0
  17. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/pyproject.toml +0 -0
  18. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/setup.cfg +0 -0
  19. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/__init__.py +0 -0
  20. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/__init__.py +0 -0
  21. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/air_purifier.py +0 -0
  22. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/blind_tilt.py +0 -0
  23. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/bot.py +0 -0
  24. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/bulb.py +0 -0
  25. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/ceiling_light.py +0 -0
  26. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/contact.py +0 -0
  27. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/curtain.py +0 -0
  28. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/fan.py +0 -0
  29. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/hub2.py +0 -0
  30. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/hubmini_matter.py +0 -0
  31. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/humidifier.py +0 -0
  32. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/keypad.py +0 -0
  33. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/leak.py +0 -0
  34. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/light_strip.py +0 -0
  35. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/lock.py +0 -0
  36. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/meter.py +0 -0
  37. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/motion.py +0 -0
  38. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/plug.py +0 -0
  39. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/relay_switch.py +0 -0
  40. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/remote.py +0 -0
  41. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/roller_shade.py +0 -0
  42. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/adv_parsers/vacuum.py +0 -0
  43. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/api_config.py +0 -0
  44. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/const/evaporative_humidifier.py +0 -0
  45. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/const/fan.py +0 -0
  46. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/const/hub2.py +0 -0
  47. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/const/lock.py +0 -0
  48. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/__init__.py +0 -0
  49. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/base_cover.py +0 -0
  50. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/base_light.py +0 -0
  51. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/blind_tilt.py +0 -0
  52. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/bot.py +0 -0
  53. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/bulb.py +0 -0
  54. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/ceiling_light.py +0 -0
  55. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/contact.py +0 -0
  56. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/curtain.py +0 -0
  57. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/device.py +0 -0
  58. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/evaporative_humidifier.py +0 -0
  59. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/fan.py +0 -0
  60. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/humidifier.py +0 -0
  61. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/keypad.py +0 -0
  62. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/light_strip.py +0 -0
  63. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/lock.py +0 -0
  64. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/meter.py +0 -0
  65. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/motion.py +0 -0
  66. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/plug.py +0 -0
  67. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/relay_switch.py +0 -0
  68. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/roller_shade.py +0 -0
  69. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/devices/vacuum.py +0 -0
  70. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/discovery.py +0 -0
  71. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/enum.py +0 -0
  72. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/helpers.py +0 -0
  73. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/switchbot/models.py +0 -0
  74. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/tests/test_base_cover.py +0 -0
  75. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/tests/test_blind_tilt.py +0 -0
  76. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/tests/test_curtain.py +0 -0
  77. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/tests/test_evaporative_humidifier.py +0 -0
  78. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/tests/test_fan.py +0 -0
  79. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/tests/test_hub2.py +0 -0
  80. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/tests/test_relay_switch.py +0 -0
  81. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/tests/test_roller_shade.py +0 -0
  82. {pyswitchbot-0.62.0 → pyswitchbot-0.62.2}/tests/test_vacuum.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySwitchbot
3
- Version: 0.62.0
3
+ Version: 0.62.2
4
4
  Summary: A library to communicate with Switchbot
5
5
  Home-page: https://github.com/sblibs/pySwitchbot/
6
6
  Author: Daniel Hjelseth Hoyer
@@ -31,7 +31,7 @@ Dynamic: requires-dist
31
31
  Dynamic: requires-python
32
32
  Dynamic: summary
33
33
 
34
- # pySwitchbot [![Build Status](https://travis-ci.org/sblibs/pySwitchbot.svg?branch=master)](https://travis-ci.org/sblibs/pySwitchbot)
34
+ # pySwitchbot [![codecov](https://codecov.io/gh/sblibs/pySwitchbot/graph/badge.svg?token=TI027U5ISQ)](https://codecov.io/gh/sblibs/pySwitchbot)
35
35
 
36
36
  Library to control Switchbot IoT devices https://www.switch-bot.com/bot
37
37
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySwitchbot
3
- Version: 0.62.0
3
+ Version: 0.62.2
4
4
  Summary: A library to communicate with Switchbot
5
5
  Home-page: https://github.com/sblibs/pySwitchbot/
6
6
  Author: Daniel Hjelseth Hoyer
@@ -31,7 +31,7 @@ Dynamic: requires-dist
31
31
  Dynamic: requires-python
32
32
  Dynamic: summary
33
33
 
34
- # pySwitchbot [![Build Status](https://travis-ci.org/sblibs/pySwitchbot.svg?branch=master)](https://travis-ci.org/sblibs/pySwitchbot)
34
+ # pySwitchbot [![codecov](https://codecov.io/gh/sblibs/pySwitchbot/graph/badge.svg?token=TI027U5ISQ)](https://codecov.io/gh/sblibs/pySwitchbot)
35
35
 
36
36
  Library to control Switchbot IoT devices https://www.switch-bot.com/bot
37
37
 
@@ -1,4 +1,4 @@
1
- # pySwitchbot [![Build Status](https://travis-ci.org/sblibs/pySwitchbot.svg?branch=master)](https://travis-ci.org/sblibs/pySwitchbot)
1
+ # pySwitchbot [![codecov](https://codecov.io/gh/sblibs/pySwitchbot/graph/badge.svg?token=TI027U5ISQ)](https://codecov.io/gh/sblibs/pySwitchbot)
2
2
 
3
3
  Library to control Switchbot IoT devices https://www.switch-bot.com/bot
4
4
 
@@ -20,7 +20,7 @@ setup(
20
20
  "cryptography>=39.0.0",
21
21
  "pyOpenSSL>=23.0.0",
22
22
  ],
23
- version="0.62.0",
23
+ version="0.62.2",
24
24
  description="A library to communicate with Switchbot",
25
25
  long_description=long_description,
26
26
  long_description_content_type="text/markdown",
@@ -282,14 +282,14 @@ SUPPORTED_TYPES: dict[str, SwitchbotSupportedType] = {
282
282
  "manufacturer_id": 2409,
283
283
  },
284
284
  "7": {
285
- "modelName": SwitchbotModel.AIR_PURIFIER,
286
- "modelFriendlyName": "Air Purifier",
285
+ "modelName": SwitchbotModel.AIR_PURIFIER_TABLE,
286
+ "modelFriendlyName": "Air Purifier Table",
287
287
  "func": process_air_purifier,
288
288
  "manufacturer_id": 2409,
289
289
  },
290
290
  "8": {
291
- "modelName": SwitchbotModel.AIR_PURIFIER,
292
- "modelFriendlyName": "Air Purifier",
291
+ "modelName": SwitchbotModel.AIR_PURIFIER_TABLE,
292
+ "modelFriendlyName": "Air Purifier Table",
293
293
  "func": process_air_purifier,
294
294
  "manufacturer_id": 2409,
295
295
  },
@@ -74,6 +74,7 @@ class SwitchbotModel(StrEnum):
74
74
  K10_PRO_VACUUM = "K10+ Pro Vacuum"
75
75
  K10_PRO_COMBO_VACUUM = "K10+ Pro Combo Vacuum"
76
76
  AIR_PURIFIER = "Air Purifier"
77
+ AIR_PURIFIER_TABLE = "Air Purifier Table"
77
78
 
78
79
 
79
80
  __all__ = [
@@ -8,8 +8,8 @@ class AirPurifierMode(Enum):
8
8
  LEVEL_2 = 2
9
9
  LEVEL_3 = 3
10
10
  AUTO = 4
11
- PET = 5
12
- SLEEP = 6
11
+ SLEEP = 5
12
+ PET = 6
13
13
 
14
14
  @classmethod
15
15
  def get_modes(cls) -> list[str]:
@@ -28,8 +28,8 @@ COMMAND_SET_MODE = {
28
28
  AirPurifierMode.LEVEL_2.name.lower(): f"{COMMAND_HEAD}01010132",
29
29
  AirPurifierMode.LEVEL_3.name.lower(): f"{COMMAND_HEAD}01010164",
30
30
  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",
33
33
  }
34
34
  DEVICE_GET_BASIC_SETTINGS_KEY = "570f4d81"
35
35
 
@@ -11,6 +11,8 @@ from switchbot.adv_parser import parse_advertisement_data
11
11
  from switchbot.const.lock import LockStatus
12
12
  from switchbot.models import SwitchBotAdvertisement
13
13
 
14
+ from . import AirPurifierTestCase
15
+
14
16
  ADVERTISEMENT_DATA_DEFAULTS = {
15
17
  "local_name": "",
16
18
  "manufacturer_data": {},
@@ -2647,9 +2649,9 @@ def test_s10_with_empty_data() -> None:
2647
2649
 
2648
2650
 
2649
2651
  @pytest.mark.parametrize(
2650
- ("manufacturer_data", "service_data", "data", "model"),
2652
+ "test_case",
2651
2653
  [
2652
- (
2654
+ AirPurifierTestCase(
2653
2655
  b"\xf0\x9e\x9e\x96j\xd6\xa1\x81\x88\xe4\x00\x01\x95\x00\x00",
2654
2656
  b"7\x00\x00\x95-\x00",
2655
2657
  {
@@ -2664,8 +2666,10 @@ def test_s10_with_empty_data() -> None:
2664
2666
  "sequence_number": 161,
2665
2667
  },
2666
2668
  "7",
2669
+ "Air Purifier Table",
2670
+ SwitchbotModel.AIR_PURIFIER_TABLE,
2667
2671
  ),
2668
- (
2672
+ AirPurifierTestCase(
2669
2673
  b'\xcc\x8d\xa2\xa7\x92>\t"\x80\x000\x00\x0f\x00\x00',
2670
2674
  b"*\x00\x00\x15\x04\x00",
2671
2675
  {
@@ -2680,13 +2684,15 @@ def test_s10_with_empty_data() -> None:
2680
2684
  "sequence_number": 9,
2681
2685
  },
2682
2686
  "*",
2687
+ "Air Purifier",
2688
+ SwitchbotModel.AIR_PURIFIER,
2683
2689
  ),
2684
- (
2690
+ AirPurifierTestCase(
2685
2691
  b"\xcc\x8d\xa2\xa7\xe4\xa6\x0b\x83\x88d\x00\xea`\x00\x00",
2686
2692
  b"+\x00\x00\x15\x04\x00",
2687
2693
  {
2688
2694
  "isOn": True,
2689
- "mode": "pet",
2695
+ "mode": "sleep",
2690
2696
  "isAqiValid": False,
2691
2697
  "child_lock": False,
2692
2698
  "speed": 100,
@@ -2696,8 +2702,10 @@ def test_s10_with_empty_data() -> None:
2696
2702
  "sequence_number": 11,
2697
2703
  },
2698
2704
  "+",
2705
+ "Air Purifier",
2706
+ SwitchbotModel.AIR_PURIFIER,
2699
2707
  ),
2700
- (
2708
+ AirPurifierTestCase(
2701
2709
  b"\xcc\x8d\xa2\xa7\xc1\xae\x9b\x81\x8c\xb2\x00\x01\x94\x00\x00",
2702
2710
  b"8\x00\x00\x95-\x00",
2703
2711
  {
@@ -2712,8 +2720,10 @@ def test_s10_with_empty_data() -> None:
2712
2720
  "sequence_number": 155,
2713
2721
  },
2714
2722
  "8",
2723
+ "Air Purifier Table",
2724
+ SwitchbotModel.AIR_PURIFIER_TABLE,
2715
2725
  ),
2716
- (
2726
+ AirPurifierTestCase(
2717
2727
  b"\xcc\x8d\xa2\xa7\xc1\xae\x9e\xa1\x8c\x800\x01\x95\x00\x00",
2718
2728
  b"8\x00\x00\x95-\x00",
2719
2729
  {
@@ -2728,8 +2738,10 @@ def test_s10_with_empty_data() -> None:
2728
2738
  "sequence_number": 158,
2729
2739
  },
2730
2740
  "8",
2741
+ "Air Purifier Table",
2742
+ SwitchbotModel.AIR_PURIFIER_TABLE,
2731
2743
  ),
2732
- (
2744
+ AirPurifierTestCase(
2733
2745
  b"\xcc\x8d\xa2\xa7\xc1\xae\x9e\x05\x8c\x800\x01\x95\x00\x00",
2734
2746
  b"8\x00\x00\x95-\x00",
2735
2747
  {
@@ -2744,26 +2756,28 @@ def test_s10_with_empty_data() -> None:
2744
2756
  "sequence_number": 158,
2745
2757
  },
2746
2758
  "8",
2759
+ "Air Purifier Table",
2760
+ SwitchbotModel.AIR_PURIFIER_TABLE,
2747
2761
  ),
2748
2762
  ],
2749
2763
  )
2750
- def test_air_purifier_active(manufacturer_data, service_data, data, model) -> None:
2764
+ def test_air_purifier_active(test_case: AirPurifierTestCase) -> None:
2751
2765
  ble_device = generate_ble_device("aa:bb:cc:dd:ee:ff", "any")
2752
2766
  adv_data = generate_advertisement_data(
2753
- manufacturer_data={2409: manufacturer_data},
2754
- service_data={"0000fd3d-0000-1000-8000-00805f9b34fb": service_data},
2767
+ manufacturer_data={2409: test_case.manufacturer_data},
2768
+ service_data={"0000fd3d-0000-1000-8000-00805f9b34fb": test_case.service_data},
2755
2769
  rssi=-97,
2756
2770
  )
2757
2771
  result = parse_advertisement_data(ble_device, adv_data)
2758
2772
  assert result == SwitchBotAdvertisement(
2759
2773
  address="aa:bb:cc:dd:ee:ff",
2760
2774
  data={
2761
- "rawAdvData": service_data,
2762
- "data": data,
2775
+ "rawAdvData": test_case.service_data,
2776
+ "data": test_case.data,
2763
2777
  "isEncrypted": False,
2764
- "model": model,
2765
- "modelFriendlyName": "Air Purifier",
2766
- "modelName": SwitchbotModel.AIR_PURIFIER,
2778
+ "model": test_case.model,
2779
+ "modelFriendlyName": test_case.modelFriendlyName,
2780
+ "modelName": test_case.modelName,
2767
2781
  },
2768
2782
  device=ble_device,
2769
2783
  rssi=-97,
@@ -2796,7 +2810,7 @@ def test_air_purifier_passive() -> None:
2796
2810
  "sequence_number": 161,
2797
2811
  },
2798
2812
  "isEncrypted": False,
2799
- "model": "8",
2813
+ "model": "+",
2800
2814
  "modelFriendlyName": "Air Purifier",
2801
2815
  "modelName": SwitchbotModel.AIR_PURIFIER,
2802
2816
  },
@@ -171,7 +171,7 @@ async def test__get_basic_info(rawAdvData, model, response, expected):
171
171
  bytearray(
172
172
  b"\x01\xa8\xec\x8c\x08\x00\xb2\x01\x96\x00\x00\x00\xf0\x00\x00\x17"
173
173
  ),
174
- [True, 2, "sleep", True, False, "excellent", 50, 240, 2.3],
174
+ [True, 2, "pet", True, False, "excellent", 50, 240, 2.3],
175
175
  ),
176
176
  ],
177
177
  )
@@ -226,6 +226,6 @@ def test_get_modes():
226
226
  "level_2",
227
227
  "level_3",
228
228
  "auto",
229
- "pet",
230
229
  "sleep",
230
+ "pet",
231
231
  ]
File without changes
File without changes
File without changes