plasticrake / tplink-smarthome-api

TP-Link Smarthome WiFi API
MIT License
1.02k stars 141 forks source link

CLI setPowerState using -c vs. --childId for changing HS300 differs #94

Closed smitty-codes closed 3 years ago

smitty-codes commented 4 years ago

When using the following command, one of the outlets on the HS300 power strip will toggle ON as expected: tplink-smarthome-api setPowerState --childId 8006D4F1DFF8F4B0A7EAFDF4D8BE94311BF9C4DA04 192.168.1.6 true

However when using "-c" instead of "--childId" it actually turns on the entire powerstrip (all 6 outlets): tplink-smarthome-api setPowerState -c 8006D4F1DFF8F4B0A7EAFDF4D8BE94311BF9C4DA04 192.168.1.6 true

When doing the help on the setPowerState option, it does list "-c" as a valid option for passing a child ID. Maybe "-c" is getting confused with the color option that uses "-c" and "--color"?

tplink-smarthome-api setPowerState -h
Usage: tplink-smarthome-api setPowerState [options] <host> [params]

Send setPowerState to device (using Device#setPowerState)

Options:
  -t, --timeout [timeout]  timeout (ms) (default: 10000)
  **-c**, --childId [childId]  childId
  -h, --help               output usage information
plasticrake commented 3 years ago

Thanks!