Skip to content

Commit

Permalink
fix: dimmer.setGentle*Time incorrectly named parameter
Browse files Browse the repository at this point in the history
Change to `duration` from `fadeTime` for both `setGentleOffTime` and `setGentleOnTime`

Fixes #129
  • Loading branch information
plasticrake committed Jan 30, 2022
1 parent 3e53050 commit db9993f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 49 deletions.
70 changes: 28 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"sinon-chai": "^3.7.0",
"source-map-support": "^0.5.21",
"standard-version": "^9.3.2",
"tplink-smarthome-simulator": "^2.0.0",
"tplink-smarthome-simulator": "^2.0.1",
"ts-essentials": "^9.1.2",
"ts-node": "^10.4.0",
"typedoc": "^0.22.11",
Expand Down
12 changes: 6 additions & 6 deletions src/plug/dimmer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,19 +248,19 @@ export default class Dimmer {
* Set Plug `dimmer_parameters` for `gentleOffTime`.
*
* Sends `dimmer.set_gentle_off_time`. Does not support childId.
* @param fadeTime - duration in ms
* @param duration - duration in ms
* @param sendOptions
* @returns parsed JSON response
* @throws {@link ResponseError}
*/
async setGentleOffTime(
fadeTime: number,
duration: number,
sendOptions?: SendOptions
): Promise<unknown> {
return this.device.sendCommand(
{
[this.apiModuleName]: {
set_gentle_off_time: { fadeTime },
set_gentle_off_time: { duration },
},
},
undefined,
Expand All @@ -272,19 +272,19 @@ export default class Dimmer {
* Set Plug `dimmer_parameters` for `gentleOnTime`.
*
* Sends `dimmer.set_gentle_on_time`. Does not support childId.
* @param fadeTime - duration in ms
* @param duration - duration in ms
* @param sendOptions
* @returns parsed JSON response
* @throws {@link ResponseError}
*/
async setGentleOnTime(
fadeTime: number,
duration: number,
sendOptions?: SendOptions
): Promise<unknown> {
return this.device.sendCommand(
{
[this.apiModuleName]: {
set_gentle_on_time: { fadeTime },
set_gentle_on_time: { duration },
},
},
undefined,
Expand Down

0 comments on commit db9993f

Please sign in to comment.