From 854c9d81cb0c6ed16c2e43ffa862662ea35b9e5b Mon Sep 17 00:00:00 2001 From: Ryo Ochiai Date: Tue, 4 Feb 2025 00:20:26 +0900 Subject: [PATCH] :bug: Fix the return value of SwitchBotOpenAPI.getDeviceStatus() --- src/switchbot-openapi.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switchbot-openapi.ts b/src/switchbot-openapi.ts index ce8050d6..770be780 100644 --- a/src/switchbot-openapi.ts +++ b/src/switchbot-openapi.ts @@ -198,7 +198,7 @@ export class SwitchBotOpenAPI extends EventEmitter { const configToken = token || this.token const configSecret = secret || this.secret const { body, statusCode } = await request(`${urls.devicesURL}/${deviceId}/status`, { headers: this.generateHeaders(configToken, configSecret) }) - const response = await body.json() as deviceStatus + const { body: response } = await body.json() as deviceStatusRequest this.emitLog('debug', `Got device status: ${deviceId}`) this.emitLog('debug', `statusCode: ${statusCode}`) return { response, statusCode }