Browse Source

Switch curtain commands to ones captured from the app (#122)

J. Nick Koston 3 days ago
parent
commit
c56c2eea07
1 changed files with 5 additions and 4 deletions
  1. 5 4
      switchbot/devices/curtain.py

+ 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"