diff --git a/index.d.ts b/index.d.ts index 9b66596..1cfe04f 100644 --- a/index.d.ts +++ b/index.d.ts @@ -75,7 +75,7 @@ declare module 'tuyapi' { disconnect(): void; isConnected(): boolean; - get(options: GetOptions): Promise; + get(options: GetOptions): Promise; refresh(options: RefreshOptions): Promise; set(options: SingleSetOptions|MultipleSetOptions): Promise; toggle(property: number): Promise; diff --git a/index.js b/index.js index d5b8a91..e83fa65 100644 --- a/index.js +++ b/index.js @@ -131,7 +131,7 @@ class TuyaDevice extends EventEmitter { * @example * // get all available data from device * tuya.get({schema: true}).then(data => console.log(data)) - * @returns {Promise} + * @returns {Promise} * returns boolean if single property is requested, otherwise returns object of results */ async get(options = {}) { @@ -183,7 +183,7 @@ class TuyaDevice extends EventEmitter { data = await this.set(setOptions); } - if (data === undefined || typeof data !== 'object' || options.schema === true) { + if (typeof data !== 'object' || options.schema === true) { // Return whole response return data; }