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.
Files changed (75) hide show
  1. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/PKG-INFO +1 -1
  2. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/PySwitchbot.egg-info/PKG-INFO +1 -1
  3. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/setup.py +1 -1
  4. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/fan.py +1 -1
  5. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/const/fan.py +1 -1
  6. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/fan.py +5 -5
  7. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_adv_parser.py +2 -2
  8. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_fan.py +6 -6
  9. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/LICENSE +0 -0
  10. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/MANIFEST.in +0 -0
  11. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/PySwitchbot.egg-info/SOURCES.txt +0 -0
  12. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/PySwitchbot.egg-info/dependency_links.txt +0 -0
  13. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/PySwitchbot.egg-info/requires.txt +0 -0
  14. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/PySwitchbot.egg-info/top_level.txt +0 -0
  15. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/README.md +0 -0
  16. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/pyproject.toml +0 -0
  17. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/setup.cfg +0 -0
  18. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/__init__.py +0 -0
  19. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parser.py +0 -0
  20. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/__init__.py +0 -0
  21. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/blind_tilt.py +0 -0
  22. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/bot.py +0 -0
  23. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/bulb.py +0 -0
  24. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/ceiling_light.py +0 -0
  25. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/contact.py +0 -0
  26. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/curtain.py +0 -0
  27. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/hub2.py +0 -0
  28. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/hubmini_matter.py +0 -0
  29. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/humidifier.py +0 -0
  30. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/keypad.py +0 -0
  31. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/leak.py +0 -0
  32. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/light_strip.py +0 -0
  33. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/lock.py +0 -0
  34. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/meter.py +0 -0
  35. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/motion.py +0 -0
  36. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/plug.py +0 -0
  37. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/relay_switch.py +0 -0
  38. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/remote.py +0 -0
  39. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/adv_parsers/roller_shade.py +0 -0
  40. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/api_config.py +0 -0
  41. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/const/__init__.py +0 -0
  42. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/const/evaporative_humidifier.py +0 -0
  43. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/const/hub2.py +0 -0
  44. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/const/lock.py +0 -0
  45. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/__init__.py +0 -0
  46. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/base_cover.py +0 -0
  47. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/base_light.py +0 -0
  48. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/blind_tilt.py +0 -0
  49. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/bot.py +0 -0
  50. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/bulb.py +0 -0
  51. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/ceiling_light.py +0 -0
  52. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/contact.py +0 -0
  53. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/curtain.py +0 -0
  54. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/device.py +0 -0
  55. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/evaporative_humidifier.py +0 -0
  56. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/humidifier.py +0 -0
  57. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/keypad.py +0 -0
  58. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/light_strip.py +0 -0
  59. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/lock.py +0 -0
  60. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/meter.py +0 -0
  61. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/motion.py +0 -0
  62. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/plug.py +0 -0
  63. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/relay_switch.py +0 -0
  64. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/devices/roller_shade.py +0 -0
  65. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/discovery.py +0 -0
  66. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/enum.py +0 -0
  67. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/helpers.py +0 -0
  68. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/switchbot/models.py +0 -0
  69. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_base_cover.py +0 -0
  70. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_blind_tilt.py +0 -0
  71. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_curtain.py +0 -0
  72. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_evaporative_humidifier.py +0 -0
  73. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_hub2.py +0 -0
  74. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_relay_switch.py +0 -0
  75. {pyswitchbot-0.60.0 → pyswitchbot-0.60.1}/tests/test_roller_shade.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySwitchbot
3
- Version: 0.60.0
3
+ Version: 0.60.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.60.0
3
+ Version: 0.60.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.60.0",
23
+ version="0.60.1",
24
24
  description="A library to communicate with Switchbot",
25
25
  long_description=long_description,
26
26
  long_description_content_type="text/markdown",
@@ -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)
@@ -11,4 +11,4 @@ class FanMode(Enum):
11
11
 
12
12
  @classmethod
13
13
  def get_modes(cls) -> list[str]:
14
- return [mode.name for mode in cls]
14
+ return [mode.name.lower() for mode in cls]
@@ -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": "BABY",
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": "BABY",
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, "NORMAL", 61, 1.1],
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, "BABY", 43, 1.1],
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": "BABY"})
124
- await fan_device.set_preset_mode("BABY")
125
- assert fan_device.get_current_mode() == "BABY"
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() == ["NORMAL", "NATURAL", "SLEEP", "BABY"]
172
+ assert FanMode.get_modes() == ["normal", "natural", "sleep", "baby"]
File without changes
File without changes
File without changes
File without changes