You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/switchbot-openapi.ts
+26-16Lines changed: 26 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,8 @@ export class SwitchBotOpenAPI extends EventEmitter {
90
90
91
91
/**
92
92
* Retrieves the list of devices from the SwitchBot OpenAPI.
93
-
*
93
+
* @param token - (Optional) The token used for authentication. If not provided, the instance token will be used.
94
+
* @param secret - (Optional) The secret used for authentication. If not provided, the instance secret will be used.
94
95
* @returns {Promise<{ response: body, statusCode: number }>} A promise that resolves to an object containing the API response.
95
96
* @throws {Error} Throws an error if the request to get devices fails.
96
97
*/
@@ -112,11 +113,13 @@ export class SwitchBotOpenAPI extends EventEmitter {
112
113
/**
113
114
* Controls a device by sending a command to the SwitchBot API.
114
115
*
115
-
* @param deviceId - The unique identifier of the device to control.
116
+
* @param deviceId - The ID of the device to control.
116
117
* @param command - The command to send to the device.
117
118
* @param parameter - The parameter for the command.
118
-
* @param commandType - The type of the command, defaults to 'command'.
119
-
* @returns {Promise<{ response: pushResponse['body'], statusCode: pushResponse['statusCode'] }>} A promise that resolves to an object containing the API response.
119
+
* @param commandType - The type of the command (default is 'command').
120
+
* @param token - (Optional) The token used for authentication. If not provided, the instance token will be used.
121
+
* @param secret - (Optional) The secret used for authentication. If not provided, the instance secret will be used.
122
+
* @returns A promise that resolves to an object containing the response body and status code.
0 commit comments