2 Commits e2d9b046b8 ... d4bd047c5d

Author SHA1 Message Date
  J. Nick Koston d4bd047c5d 0.19.11 3 days ago
  J. Nick Koston c56c2eea07 Switch curtain commands to ones captured from the app (#122) 3 days ago
2 changed files with 6 additions and 5 deletions
  1. 1 1
      setup.py
  2. 5 4
      switchbot/devices/curtain.py

+ 1 - 1
setup.py

@@ -4,7 +4,7 @@ setup(
     name="PySwitchbot",
     packages=["switchbot", "switchbot.devices", "switchbot.adv_parsers"],
     install_requires=["async_timeout>=4.0.1", "bleak>=0.17.0", "bleak-retry-connector>=1.17.1"],
-    version="0.19.10",
+    version="0.19.11",
     description="A library to communicate with Switchbot",
     author="Daniel Hjelseth Hoyer",
     url="https://github.com/Danielhiversen/pySwitchbot/",

+ 5 - 4
switchbot/devices/curtain.py

@@ -7,10 +7,11 @@ from typing import Any
 from .device import REQ_HEADER, SwitchbotDevice
 
 # Curtain keys
-OPEN_KEY = f"{REQ_HEADER}450105ff00"  # 570F4501010100
-CLOSE_KEY = f"{REQ_HEADER}450105ff64"  # 570F4501010164
-POSITION_KEY = f"{REQ_HEADER}450105ff"  # +actual_position ex: 570F450105ff32 for 50%
-STOP_KEY = f"{REQ_HEADER}450100ff"
+CURTAIN_COMMAND = "4501"
+OPEN_KEY = f"{REQ_HEADER}{CURTAIN_COMMAND}010100"
+CLOSE_KEY = f"{REQ_HEADER}{CURTAIN_COMMAND}010164"
+POSITION_KEY = f"{REQ_HEADER}{CURTAIN_COMMAND}0101"  # +actual_position
+STOP_KEY = f"{REQ_HEADER}{CURTAIN_COMMAND}0001"
 CURTAIN_EXT_SUM_KEY = f"{REQ_HEADER}460401"
 CURTAIN_EXT_ADV_KEY = f"{REQ_HEADER}460402"
 CURTAIN_EXT_CHAIN_INFO_KEY = f"{REQ_HEADER}468101"