plasticrake / tplink-smarthome-api

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

Anomalies in src\plug\dimmers #129

Closed DaveGut closed 2 years ago

DaveGut commented 2 years ago

First - as usual thanks for the great examples in your files. I was finalizing my Hubitat Dimming Switch Driver and noted the following anomalies:

async setDimmerTransition: This command takes either mode or brightness. If mode is expressed, brightness is ignored. For mode, it takes "gentle_on_off" or "instant_on_off".

async setGentleOffTime and setGentleOnTime: This commands uses "duration" instead of "fadeTime".

Dave Gutheinz

plasticrake commented 2 years ago

setDimmerTransition: Is there an issue around this? Currently in the code it can take 3 parameters but they are each optional. And since JSON.stringify is run on them, any undefined keys would be removed from the object. That should let you ignore brightness for example.

setGentleOffTime: You're right! I don't have these devices but I think I copied something incorrectly from my notes. I'll fix this