PySwitchbot 2.7.0__py3-none-any.whl → 2.7.1__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySwitchbot
3
- Version: 2.7.0
3
+ Version: 2.7.1
4
4
  Summary: A library to communicate with Switchbot
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -93,10 +93,10 @@ from switchbot.discovery import GetSwitchbotDevices
93
93
  from switchbot.devices import lock
94
94
  from switchbot.const import SwitchbotModel
95
95
 
96
- BLE_MAC="XX:XX:XX:XX:XX:XX" # The MAC of your lock
97
- KEY_ID="XX" # The key-ID of your encryption-key for your lock
98
- ENC_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" # The encryption-key with key-ID "XX"
99
- LOCK_MODEL=SwitchbotModel.LOCK_PRO # Your lock model (here we use the Lock-Pro)
96
+ BLE_MAC = "XX:XX:XX:XX:XX:XX" # The MAC of your lock
97
+ KEY_ID = "XX" # The key-ID of your encryption-key for your lock
98
+ ENC_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" # The encryption-key with key-ID "XX"
99
+ LOCK_MODEL = SwitchbotModel.LOCK_PRO # Your lock model (here we use the Lock-Pro)
100
100
 
101
101
 
102
102
  async def main():
@@ -117,10 +117,10 @@ from switchbot.discovery import GetSwitchbotDevices
117
117
  from switchbot.devices import lock
118
118
  from switchbot.const import SwitchbotModel
119
119
 
120
- BLE_MAC="XX:XX:XX:XX:XX:XX" # The MAC of your lock
121
- KEY_ID="XX" # The key-ID of your encryption-key for your lock
122
- ENC_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" # The encryption-key with key-ID "XX"
123
- LOCK_MODEL=SwitchbotModel.LOCK_PRO # Your lock model (here we use the Lock-Pro)
120
+ BLE_MAC = "XX:XX:XX:XX:XX:XX" # The MAC of your lock
121
+ KEY_ID = "XX" # The key-ID of your encryption-key for your lock
122
+ ENC_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" # The encryption-key with key-ID "XX"
123
+ LOCK_MODEL = SwitchbotModel.LOCK_PRO # Your lock model (here we use the Lock-Pro)
124
124
 
125
125
 
126
126
  async def main():
@@ -1,5 +1,5 @@
1
1
  switchbot/__init__.py,sha256=iItr_zGA3ARTGbneIjVDyW9fi6EviVFqN2yHyvMI5wA,4332
2
- switchbot/__version__.py,sha256=EtKWW0Hnl5oWglRNH0HZigvcDT2FEs58ek8buJdwW1E,22
2
+ switchbot/__version__.py,sha256=yRpSH6mBb4BJgbFlT7rt8MSjCUW17Ycx0RziLf-lQLA,22
3
3
  switchbot/adv_parser.py,sha256=O5cVtZq4IRozO7X76hIrrQCGPna78Z7YHHkbROyHWcI,35353
4
4
  switchbot/adv_parsers/__init__.py,sha256=d39GEAICA1RrQiLy1ks49x0d9a-A_yKn9Awkj5za8Uk,46
5
5
  switchbot/adv_parsers/_sensor_th.py,sha256=ze182l3_YFHJJv98_vq6qB2twlUTExkxoC1sLZL3TLs,1199
@@ -51,7 +51,7 @@ switchbot/devices/base_light.py,sha256=WWJJdRHfvoSYMRHDSv_RCmo5D6hYoZRxQVYfsOXZ7
51
51
  switchbot/devices/blind_tilt.py,sha256=tY0JoZhyqU_6PlhjtnIaEeIG3Z-JdZKJ5Jwg_5b6xSQ,5761
52
52
  switchbot/devices/bot.py,sha256=Co2IiQa2si0WPs3HFize2CPpj5GVbMT570vMP5YWpaQ,4121
53
53
  switchbot/devices/bulb.py,sha256=ISxXck8JsBlFojLB8M5Wfip_z4o6_-VvyFbBvqK6_Bg,2313
54
- switchbot/devices/ceiling_light.py,sha256=DypuzNHZ2TLI-xg0BauTHo9yl8LNujXc17UeW1K-oqE,2652
54
+ switchbot/devices/ceiling_light.py,sha256=PBG69_jsuDF5R_6Man22Kqk9ZW0nIemzAjniqfuQbLU,2820
55
55
  switchbot/devices/contact.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
56
56
  switchbot/devices/curtain.py,sha256=p3qcPWHaSA5ewPONl811hL7swFRca37Omb2LKYoAxgo,7086
57
57
  switchbot/devices/device.py,sha256=MmbnWHxlWGTHZmhnxFyQQXwe_Fo6Ce7lu36lA06o0UU,49713
@@ -76,7 +76,7 @@ switchbot/enum.py,sha256=0IfWypBw2oe9lWgdRkrD_1FqqeHpakCxtwlSaUlmcPg,125
76
76
  switchbot/helpers.py,sha256=DJLvYZ4Dq0dkiGMOzfR--nSTM_8jE9QtB7t570PuGSU,2091
77
77
  switchbot/models.py,sha256=xibQOVGHC60FWWc54N6BW46vxFuJUjj6tK1Qw0_eTbI,372
78
78
  switchbot/utils.py,sha256=glU1SDBeoXuu9K46nSGvg1YVWGNAGC0bo13tJ-ccDNU,724
79
- pyswitchbot-2.7.0.dist-info/METADATA,sha256=P_NtAvbLh_laeMkE4m6MkiPq7tjt0EDRE9vR1DP5WfM,5794
80
- pyswitchbot-2.7.0.dist-info/WHEEL,sha256=EGEvSphFYqXKs23-kQBeyNoJP1nrT8ZJKQoi5p5DYL8,88
81
- pyswitchbot-2.7.0.dist-info/licenses/LICENSE,sha256=_hdUCmoRDzki4fYDJfn-5KpG7-7p6YJ6IsbMfrTXN6Y,1078
82
- pyswitchbot-2.7.0.dist-info/RECORD,,
79
+ pyswitchbot-2.7.1.dist-info/METADATA,sha256=Rg_wVLedpHizkv7sjviy2_w5jF-Y68ylS52aMDRvVKM,5818
80
+ pyswitchbot-2.7.1.dist-info/WHEEL,sha256=EGEvSphFYqXKs23-kQBeyNoJP1nrT8ZJKQoi5p5DYL8,88
81
+ pyswitchbot-2.7.1.dist-info/licenses/LICENSE,sha256=_hdUCmoRDzki4fYDJfn-5KpG7-7p6YJ6IsbMfrTXN6Y,1078
82
+ pyswitchbot-2.7.1.dist-info/RECORD,,
switchbot/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.7.0"
1
+ __version__ = "2.7.1"
@@ -60,7 +60,11 @@ class SwitchbotCeilingLight(SwitchbotSequenceBaseLight):
60
60
  return None
61
61
  _version_info, _data = res
62
62
 
63
- self._state["cw"] = int.from_bytes(_data[3:5], "big")
63
+ color_temp = int.from_bytes(_data[3:5], "big")
64
+ if self.min_temp <= color_temp <= self.max_temp:
65
+ self._state["cw"] = color_temp
66
+ else:
67
+ self._state.setdefault("cw", DEFAULT_COLOR_TEMP)
64
68
 
65
69
  return {
66
70
  "isOn": bool(_data[1] & 0b10000000),