From 792cfeae3a29df47e082dd67225dc2bf5ec37838 Mon Sep 17 00:00:00 2001 From: Prasad Edlabadkar Date: Sat, 2 Jul 2022 17:03:53 +0530 Subject: [PATCH] Fixing removal logic --- .../accessories/AirConditionerAccessory.d.ts | 2 - .../AirConditionerAccessory.d.ts.map | 2 +- .../accessories/AirConditionerAccessory.js | 19 - .../AirConditionerAccessory.js.map | 2 +- dist/lib/api/TuyaAPIHelper.d.ts | 32 -- dist/lib/api/TuyaAPIHelper.d.ts.map | 1 - dist/lib/api/TuyaAPIHelper.js | 443 ------------------ dist/lib/api/TuyaAPIHelper.js.map | 1 - dist/platform.js | 2 +- dist/platform.js.map | 2 +- .../accessories/AirConditionerAccessory.ts | 21 - src/platform.ts | 2 +- 12 files changed, 5 insertions(+), 524 deletions(-) delete mode 100644 dist/lib/api/TuyaAPIHelper.d.ts delete mode 100644 dist/lib/api/TuyaAPIHelper.d.ts.map delete mode 100644 dist/lib/api/TuyaAPIHelper.js delete mode 100644 dist/lib/api/TuyaAPIHelper.js.map diff --git a/dist/lib/accessories/AirConditionerAccessory.d.ts b/dist/lib/accessories/AirConditionerAccessory.d.ts index f59b84e..84ca12c 100644 --- a/dist/lib/accessories/AirConditionerAccessory.d.ts +++ b/dist/lib/accessories/AirConditionerAccessory.d.ts @@ -19,8 +19,6 @@ export declare class AirConditionerAccessory extends BaseAccessory { refreshStatus(): void; setOn(value: CharacteristicValue): void; getOn(): CharacteristicValue; - setTargetTemperature(value: CharacteristicValue): void; - getTargetTemperature(): CharacteristicValue; setHeatingCoolingState(value: CharacteristicValue): void; getHeatingCoolingState(): CharacteristicValue; getCoolingThresholdTemperatureCharacteristic(): CharacteristicValue; diff --git a/dist/lib/accessories/AirConditionerAccessory.d.ts.map b/dist/lib/accessories/AirConditionerAccessory.d.ts.map index 0e481d5..5956b86 100644 --- a/dist/lib/accessories/AirConditionerAccessory.d.ts.map +++ b/dist/lib/accessories/AirConditionerAccessory.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"AirConditionerAccessory.d.ts","sourceRoot":"","sources":["../../../src/lib/accessories/AirConditionerAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,aAAa;IAYlD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAZ9B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,QAAQ,CAA4B;IAE5C,OAAO,CAAC,QAAQ,CAKd;gBAGmB,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,iBAAiB;IA2CjD;;MAEE;IACF,aAAa;IAmBb,KAAK,CAAC,KAAK,EAAE,mBAAmB;IAahC,KAAK,IAAI,mBAAmB;IAI5B,oBAAoB,CAAC,KAAK,EAAE,mBAAmB;IAa/C,oBAAoB,IAAI,mBAAmB;IAI3C,sBAAsB,CAAC,KAAK,EAAE,mBAAmB;IAgBjD,sBAAsB,IAAI,mBAAmB;IAI7C,4CAA4C,IAAI,mBAAmB;IAInE,4CAA4C,CAAC,KAAK,EAAE,mBAAmB;IAavE,8BAA8B,IAAI,mBAAmB;IAIrD,8BAA8B,CAAC,KAAK,EAAE,mBAAmB;IAczD,qBAAqB,IAAI,mBAAmB;IAI5C,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,KAAA;IAW7F,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAA;CAMrD"} \ No newline at end of file +{"version":3,"file":"AirConditionerAccessory.d.ts","sourceRoot":"","sources":["../../../src/lib/accessories/AirConditionerAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,aAAa;IAYlD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAZ9B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,QAAQ,CAA4B;IAE5C,OAAO,CAAC,QAAQ,CAKd;gBAGmB,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,iBAAiB;IAuCjD;;MAEE;IACF,aAAa;IAmBb,KAAK,CAAC,KAAK,EAAE,mBAAmB;IAahC,KAAK,IAAI,mBAAmB;IAI5B,sBAAsB,CAAC,KAAK,EAAE,mBAAmB;IAgBjD,sBAAsB,IAAI,mBAAmB;IAI7C,4CAA4C,IAAI,mBAAmB;IAInE,4CAA4C,CAAC,KAAK,EAAE,mBAAmB;IAavE,8BAA8B,IAAI,mBAAmB;IAIrD,8BAA8B,CAAC,KAAK,EAAE,mBAAmB;IAczD,qBAAqB,IAAI,mBAAmB;IAI5C,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,KAAA;IAW7F,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAA;CAMrD"} \ No newline at end of file diff --git a/dist/lib/accessories/AirConditionerAccessory.js b/dist/lib/accessories/AirConditionerAccessory.js index 0ca1f8d..771ddfb 100644 --- a/dist/lib/accessories/AirConditionerAccessory.js +++ b/dist/lib/accessories/AirConditionerAccessory.js @@ -30,9 +30,6 @@ class AirConditionerAccessory extends BaseAccessory_1.BaseAccessory { this.service.getCharacteristic(this.platform.Characteristic.TargetHeaterCoolerState) .onSet(this.setHeatingCoolingState.bind(this)) .onGet(this.getHeatingCoolingState.bind(this)); - this.service.getCharacteristic(this.platform.Characteristic.TargetTemperature) - .onSet(this.setTargetTemperature.bind(this)) - .onGet(this.getTargetTemperature.bind(this)); this.service.getCharacteristic(this.platform.Characteristic.CurrentTemperature) .onGet(this.getCurrentTemperature.bind(this)); this.service.getCharacteristic(this.platform.Characteristic.CoolingThresholdTemperature) @@ -88,22 +85,6 @@ class AirConditionerAccessory extends BaseAccessory_1.BaseAccessory { getOn() { return this.acStates.On; } - setTargetTemperature(value) { - const command = value; - this.sendACCommand(this.parentId, this.accessory.context.device.id, "temp", command, (body) => { - if (!body.success) { - this.log.error(`Failed to change AC temperature due to error ${body.msg}`); - } - else { - this.log.info(`${this.accessory.displayName} temperature is set to ${command} degrees.`); - this.acStates.temperature = command; - this.service.updateCharacteristic(this.platform.Characteristic.CurrentTemperature, command); - } - }); - } - getTargetTemperature() { - return this.acStates.temperature; - } setHeatingCoolingState(value) { const val = value; let command = 2; diff --git a/dist/lib/accessories/AirConditionerAccessory.js.map b/dist/lib/accessories/AirConditionerAccessory.js.map index 06b191d..bd0a030 100644 --- a/dist/lib/accessories/AirConditionerAccessory.js.map +++ b/dist/lib/accessories/AirConditionerAccessory.js.map @@ -1 +1 @@ -{"version":3,"file":"AirConditionerAccessory.js","sourceRoot":"","sources":["../../../src/lib/accessories/AirConditionerAccessory.ts"],"names":[],"mappings":";;;AAEA,mDAAgD;AAChD,oEAAiE;AAEjE;;;;GAIG;AACH,MAAa,uBAAwB,SAAQ,6BAAa;IAWtD,YACqB,QAAwB,EACxB,SAA4B;;QAE7C,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAHV,aAAQ,GAAR,QAAQ,CAAgB;QACxB,cAAS,GAAT,SAAS,CAAmB;QAXzC,aAAQ,GAAG,CAA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AmB,QAAQ,qBAAqB,QAAQ,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE;YAC5L,EAAE,CAAC,IAAI,CAAC,CAAC;QACb,CAAC,CAAC,CAAA;IACN,CAAC;IAED,WAAW,CAAC,QAAgB,EAAE,QAAgB,EAAE,EAAE;QAC9C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;QACpC,yCAAmB,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,GAAG,mBAAmB,QAAQ,YAAY,QAAQ,YAAY,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;YAC5K,EAAE,CAAC,IAAI,CAAC,CAAC;QACb,CAAC,CAAC,CAAA;IACN,CAAC;CACJ;AA5LD,0DA4LC"} \ No newline at end of file +{"version":3,"file":"AirConditionerAccessory.js","sourceRoot":"","sources":["../../../src/lib/accessories/AirConditionerAccessory.ts"],"names":[],"mappings":";;;AAEA,mDAAgD;AAChD,oEAAiE;AAEjE;;;;GAIG;AACH,MAAa,uBAAwB,SAAQ,6BAAa;IAWtD,YACqB,QAAwB,EACxB,SAA4B;;QAE7C,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAHV,aAAQ,GAAR,QAAQ,CAAgB;QACxB,cAAS,GAAT,SAAS,CAAmB;QAXzC,aAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAEpC,aAAQ,GAAG;YACf,EAAE,EAAE,KAAK;YACT,WAAW,EAAE,EAAE;YACf,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;SACV,CAAC;QAQE,MAAA,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,oBAAoB,CAAC,0CAC/D,iBAAiB,CAAC,IAAI,CAAC,Q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EAAE,CAAC,IAAI,CAAC,CAAC;QACb,CAAC,CAAC,CAAA;IACN,CAAC;IAED,WAAW,CAAC,QAAgB,EAAE,QAAgB,EAAE,EAAE;QAC9C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;QACpC,yCAAmB,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,GAAG,mBAAmB,QAAQ,YAAY,QAAQ,YAAY,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;YAC5K,EAAE,CAAC,IAAI,CAAC,CAAC;QACb,CAAC,CAAC,CAAA;IACN,CAAC;CACJ;AAvKD,0DAuKC"} \ No newline at end of file diff --git a/dist/lib/api/TuyaAPIHelper.d.ts b/dist/lib/api/TuyaAPIHelper.d.ts deleted file mode 100644 index 32c0cbe..0000000 --- a/dist/lib/api/TuyaAPIHelper.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Logger } from "homebridge"; -import { TuyaIRConfiguration } from "../model/TuyaIRConfiguration"; -export declare class TuyaAPIHelper { - private config; - private constructor(); - private accessToken; - private refreshToken; - private clientId; - private clientSecret; - private apiHost; - private timestamp; - private signKey; - private log; - private static _instance; - static Instance(config: TuyaIRConfiguration, log: Logger): TuyaAPIHelper; - login(cb: any): void; - fetchDevices(deviceId: string, cb: any): void; - _manualFetch(cb: any): void; - sendLearningCode(deviceId: string, remoteId: string, code: string, cb: any): void; - fetchLearningCodes(deviceId: string, remoteId: string, cb: any): void; - sendACCommand(deviceId: string, remoteId: string, command: string, value: string | number, cb: any): void; - getACStatus(deviceId: string, remoteId: string, cb: any): void; - sendFanCommand(deviceId: string, remoteId: string, command: string | number, diy: boolean | undefined, cb: any): void; - getFanCommands(deviceId: string, remoteId: string, diy: boolean | undefined, cb: any): void; - _refreshToken(): void; - _calculateSign(withAccessToken: boolean, query: string, url: string, httpMethod: string, body?: string): void; - _loginApiCall(endpoint: string, body: object, cb: any): void; - _apiCall(endpoint: string, method: string, body: object, cb: any): void; - _stringToSign(query: any, url: any, method: any, body: any): {}; - toJsonObj(params: any, arr: any, map: any): void; -} -//# sourceMappingURL=TuyaAPIHelper.d.ts.map \ No newline at end of file diff --git a/dist/lib/api/TuyaAPIHelper.d.ts.map b/dist/lib/api/TuyaAPIHelper.d.ts.map deleted file mode 100644 index 3bbb0bb..0000000 --- a/dist/lib/api/TuyaAPIHelper.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TuyaAPIHelper.d.ts","sourceRoot":"","sources":["../../../src/lib/api/TuyaAPIHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAMnE,qBAAa,aAAa;IACF,OAAO,CAAC,MAAM;IAAlC,OAAO;IAQP,OAAO,CAAC,WAAW,CAAM;IACzB,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,QAAQ,CAAM;IACtB,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,SAAS,CAAgC;IACjD,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,GAAG,CAAS;IAEpB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAgB;WAE1B,QAAQ,CAAC,MAAM,EAAE,mBAAmB,EAAE,GAAG,EAAE,MAAM;IAO/D,KAAK,CAAC,EAAE,KAAA;IA2BR,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAA;IAuDjC,YAAY,CAAC,EAAE,KAAA;IAsCf,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAC,MAAM,EAAE,EAAE,KAAA;IAepE,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAA;IAezD,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,KAAA;IAmB7F,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAA;IAelD,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,qBAAQ,EAAE,EAAE,KAAA;IAuB5F,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,qBAAQ,EAAE,EAAE,KAAA;IAiFlE,aAAa;IA0Bb,cAAc,CAAC,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,SAAK;IAQlG,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,KAAA;IA0BhD,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,KAAA;IAgC3D,aAAa,CAAC,KAAK,KAAA,EAAE,GAAG,KAAA,EAAE,MAAM,KAAA,EAAE,IAAI,KAAA;IAatC,SAAS,CAAC,MAAM,KAAA,EAAE,GAAG,KAAA,EAAE,GAAG,KAAA;CAU7B"} \ No newline at end of file diff --git a/dist/lib/api/TuyaAPIHelper.js b/dist/lib/api/TuyaAPIHelper.js deleted file mode 100644 index 5d24761..0000000 --- a/dist/lib/api/TuyaAPIHelper.js +++ /dev/null @@ -1,443 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TuyaAPIHelper = void 0; -const crypto_js_1 = __importDefault(require("crypto-js")); -const request_1 = __importDefault(require("request")); -const url_1 = require("url"); -class TuyaAPIHelper { - constructor(config, log) { - this.config = config; - this.accessToken = ""; - this.refreshToken = ""; - this.clientId = ""; - this.clientSecret = ""; - this.apiHost = ""; - this.timestamp = new Date().getTime(); - this.signKey = ""; - this.clientId = config.tuyaAPIClientId; - this.clientSecret = config.tuyaAPISecret; - this.apiHost = `https://openapi.tuya${config.deviceRegion}.com`; - this.log = log; - this.config = config; - } - static Instance(config, log) { - return this._instance || (this._instance = new this(config, log)); - // c.config = config; - // c.log = log; - //return c; - } - login(cb) { - this.log.info(`Logging in to the the server ${this.apiHost}...`); - this._loginApiCall(this.apiHost + "/v1.0/token?grant_type=1", {}, (_body) => { - let body; - try { - body = JSON.parse(_body); - } - catch (error) { - body = { msg: "Unable to parse body." }; - } - if (body.success) { - this.log.info(`Login successful.`); - this.accessToken = body.result.access_token; - this.refreshToken = body.result.refresh_token; - setTimeout(() => { - this._refreshToken(); - }, (body.result.expire_time - 5) * 1000); - cb(); - } - else { - this.log.error(`Failed to login due to error '${body.msg}'. Retying after 1 minute...`); - setTimeout(() => { - this.login(cb); - }, 60000); - } - }); - } - fetchDevices(deviceId, cb) { - this.log.debug(`This is the config: ${JSON.stringify(this.config)}`); - if (!this.config.autoFetchRemotesFromServer) { - this.log.info("Auto discovery of remotes disabled..."); - this._manualFetch(cb); - } - else { - this._apiCall(this.apiHost + `/v1.0/infrareds/${deviceId}/remotes`, "GET", {}, (_body, err) => { - if (err) { - this.log.error("Failed to get remotes device: " + deviceId); - cb([]); - } - else { - const devs = []; - let body; - try { - body = JSON.parse(_body); - } - catch (error) { - this.log.error("Unable to parse message body" + error); - devs.push({}); - cb(devs); - return; - } - if (!body.result) { - this.log.warn("API didn't return any devices Using hardcoded devices..."); - this._manualFetch(cb); - } - else { - this.log.warn(`API returned ${body.result.length} remotes...`); - for (let i = 0; i < body.result.length; i++) { - this._apiCall(this.apiHost + `/v1.0/devices/${body.result[i].remote_id}`, "GET", {}, (_b, err) => { - if (err) { - this.log.error("Failed to get remote configuration for: " + body.result[i].remote_id); - devs.push({}); - } - else { - this.log.debug(_b); - let _body; - try { - _body = JSON.parse(_b); - devs.push(_body.result); - } - catch (error) { - this.log.error("Unable to parse message body" + error); - devs.push({}); - } - } - if (devs.length == body.result.length) { - cb(devs); - } - }); - } - } - } - }); - } - } - _manualFetch(cb) { - const devs = []; - for (let i = 0; i < this.config.configuredRemotes.length; i++) { - const dev = this.config.configuredRemotes[i]; - this._apiCall(this.apiHost + `/v1.0/devices/${dev.id}`, "GET", {}, (_b, err) => { - if (err) { - this.log.error("Failed to get remote configuration for: " + dev.id); - devs.push({}); - } - else { - this.log.debug(_b); - let bd; - try { - bd = JSON.parse(_b); - } - catch (error) { - this.log.error("Unable to parse message body" + error); - devs.push({}); - cb(devs); - return; - } - if (!bd.success) { - this.log.error("Failed to get remote configuration for: " + dev.id); - this.log.error(`Server returned error: '${bd.msg}'`); - devs.push({}); - } - else { - bd.result.diy = dev.diy; - bd.result.model = dev.model; - bd.result.brand = dev.brand; - devs.push(bd.result); - } - } - if (devs.length == this.config.configuredRemotes.length) { - cb(devs); - } - }); - } - } - sendLearningCode(deviceId, remoteId, code, cb) { - this.log.debug("Sending Learning Code"); - this._apiCall(this.apiHost + `/v2.0/infrareds/${deviceId}/remotes/${remoteId}/learning-codes`, "POST", { code }, (_body, err) => { - let body = { success: false, msg: "Failed to invoke API" }; - if (!err) { - try { - body = JSON.parse(_body); - } - catch (error) { - this.log.error("Unable to parse message body" + error); - } - } - cb(body); - }); - } - fetchLearningCodes(deviceId, remoteId, cb) { - this.log.debug("Getting Learning Codes"); - this._apiCall(this.apiHost + `/v2.0/infrareds/${deviceId}/remotes/${remoteId}/learning-codes`, "GET", {}, (_body, err) => { - let body = { success: false, msg: "Failed to invoke API" }; - if (!err) { - try { - body = JSON.parse(_body); - } - catch (error) { - this.log.error("Unable to parse message body" + error); - } - } - cb(body); - }); - } - sendACCommand(deviceId, remoteId, command, value, cb) { - const commandObj = { - "code": command, - "value": value - }; - this.log.debug(JSON.stringify(commandObj)); - this._apiCall(this.apiHost + `/v1.0/infrareds/${deviceId}/air-conditioners/${remoteId}/command`, "POST", commandObj, (_body, err) => { - let body = { success: false, msg: "Failed to invoke API" }; - if (!err) { - try { - body = JSON.parse(_body); - } - catch (error) { - this.log.error("Unable to parse message body" + error); - } - } - cb(body); - }); - } - getACStatus(deviceId, remoteId, cb) { - this.log.debug("Getting AC Status"); - this._apiCall(this.apiHost + `/v2.0/infrareds/${deviceId}/remotes/${remoteId}/ac/status`, "GET", {}, (_body, err) => { - let body = { success: false, msg: "Failed to invoke API" }; - if (!err) { - try { - body = JSON.parse(_body); - } - catch (error) { - this.log.error("Unable to parse message body" + error); - } - } - cb(body); - }); - } - sendFanCommand(deviceId, remoteId, command, diy = false, cb) { - const commandObj = diy ? { - "code": command - } : { - "raw_key": command - }; - const url = diy ? `${this.apiHost}/v1.0/infrareds/${deviceId}/remotes/${remoteId}/learning-codes` : `${this.apiHost}/v1.0/infrareds/${deviceId}/remotes/${remoteId}/raw/command`; - this.log.debug(JSON.stringify(commandObj)); - this._apiCall(url, "POST", commandObj, (_body, err) => { - let body = { success: false, msg: "Failed to invoke API" }; - if (!err) { - try { - body = JSON.parse(_body); - } - catch (error) { - this.log.error("Unable to parse message body" + error); - } - } - cb(body); - }); - } - getFanCommands(deviceId, remoteId, diy = false, cb) { - this.log.debug("Getting commands for Fan..."); - if (diy) { - this.log.debug("Getting commands for DIY Fan..."); - this._apiCall(this.apiHost + `/v1.0/infrareds/${deviceId}/remotes/${remoteId}/learning-codes`, "GET", {}, (_body, err) => { - let body; - if (!err) { - try { - body = JSON.parse(_body); - } - catch (error) { - this.log.error("Unable to parse message body" + error); - } - if (body.success) { - const ret = { power: "", speed: "", swing: "" }; - for (let i = 0; i < body.result.length; i++) { - const k = body.result[i]; - if (k.key_name == 'power') { - ret.power = k.code; - } - else if (k.key_name == 'fan_speed') { - ret.speed = k.code; - } - else if (k.key_name == 'swing') { - ret.swing = k.code; - } - } - cb(ret); - } - else { - this.log.error("Failed to invoke API"); - cb(); - } - } - else { - this.log.error("Failed to invoke API", err); - cb(); - } - }); - } - else { - this.log.debug("First getting brand id and remote id for given device..."); - this._apiCall(this.apiHost + `/v1.0/infrareds/${deviceId}/remotes/${remoteId}/keys`, "GET", {}, (_body, err) => { - let body; - if (!err) { - try { - body = JSON.parse(_body); - } - catch (error) { - this.log.error("Unable to parse message body" + error); - cb(); - return; - } - this.log.debug(`Found category id: ${body.result.category_id}, brand id: ${body.result.brand_id}, remote id: ${body.result.remote_index}`); - this._apiCall(this.apiHost + `/v1.0/infrareds/${deviceId}/categories/${body.result.category_id}/brands/${body.result.brand_id}/remotes/${body.result.remote_index}/rules`, "GET", {}, (_body2, err2) => { - let body2; - try { - body2 = JSON.parse(_body2); - } - catch (error) { - this.log.error("Unable to parse message body" + error); - } - if (!err2 && body2.success) { - //let body2 = JSON.parse(_body2); - const ret = { power: "", speed: "", swing: "" }; - for (let i = 0; i < body2.result.length; i++) { - const k = body2.result[i]; - if (k.key_name == 'power') { - ret.power = k.key; - } - else if (k.key_name == 'fan_speed') { - ret.speed = k.key; - } - else if (k.key_name == 'swing') { - ret.swing = k.key; - } - } - cb(ret); - } - else { - this.log.error("Failed to invoke API", err2 || body2.msg); - cb(); - } - }); - } - else { - this.log.error("Failed to invoke API", err); - cb(); - } - }); - } - } - _refreshToken() { - this.log.info("Need to refresh token now..."); - // eslint-disable-next-line @typescript-eslint/no-this-alias - const _this = this; - this._loginApiCall(this.apiHost + "/v1.0/token/" + this.refreshToken, {}, (_body) => { - let body; - try { - body = JSON.parse(_body); - } - catch (error) { - this.log.error("Unable to parse message body" + error); - } - if (body.success) { - _this.accessToken = body.result.access_token; - _this.refreshToken = body.result.refresh_token; - _this.log.info(`Token refreshed successfully. Next refresh after ${body.result.expire_time} seconds`); - setTimeout(() => { - this._refreshToken(); - }, (body.result.expire_time - 5) * 1000); - } - else { - _this.log.error(`Unable to refresh token: ${body.msg}. Trying fresh login...`); - // eslint-disable-next-line @typescript-eslint/no-empty-function - this.login(() => { }); - } - }); - } - _calculateSign(withAccessToken, query, url, httpMethod, body = "") { - this.timestamp = new Date().getTime(); - const signMap = this._stringToSign(query, url, httpMethod, body); - const signStr = signMap["signUrl"]; - const str = withAccessToken ? this.clientId + this.accessToken + this.timestamp + signStr : this.clientId + this.timestamp + signStr; - this.signKey = crypto_js_1.default.HmacSHA256(str, this.clientSecret).toString().toUpperCase(); - } - _loginApiCall(endpoint, body, cb) { - // eslint-disable-next-line @typescript-eslint/no-this-alias - const _this = this; - const parsedUrl = new url_1.URL(endpoint); - this._calculateSign(false, parsedUrl.search, parsedUrl.pathname, 'GET'); - const options = { - url: endpoint, - headers: { - 'client_id': this.clientId, - 'sign': this.signKey, - 't': this.timestamp, - 'sign_method': 'HMAC-SHA256', - 'nonce': '' - } - }; - request_1.default.get(options, function (error, response, body) { - _this.log.debug("API call successful."); - cb(body); - }) - .on('error', (err) => { - _this.log.error("API call failed."); - _this.log.error(err); - }); - } - _apiCall(endpoint, method, body, cb) { - this.log.debug(`Calling endpoint ${endpoint}`); - // eslint-disable-next-line @typescript-eslint/no-this-alias - const _this = this; - const parsedUrl = new url_1.URL(endpoint); - this._calculateSign(true, parsedUrl.search, parsedUrl.pathname, method, JSON.stringify(body)); - const options = { - method: method, - url: endpoint, - headers: { - 'client_id': this.clientId, - 'sign': this.signKey, - 't': this.timestamp, - 'access_token': this.accessToken, - 'sign_method': 'HMAC-SHA256', - 'Content-Type': 'application/json' - }, - body: JSON.stringify(body) - }; - request_1.default(options, function (error, response, body) { - // body is the decompressed response body - _this.log.debug("API call successful."); - _this.log.debug(body); - cb(body, error); - }) - .on('error', (err) => { - _this.log.error("API call failed."); - _this.log.error(err); - }); - } - // Generate signature string - _stringToSign(query, url, method, body) { - let sha256 = ""; - const headersStr = ""; - const map = {}; - const bodyStr = body || ""; - sha256 = crypto_js_1.default.SHA256(bodyStr); - url = url + query; - map["signUrl"] = method + "\n" + sha256 + "\n" + headersStr + "\n" + url; - map["url"] = url; - return map; - } - toJsonObj(params, arr, map) { - const jsonBodyStr = JSON.stringify(params); - const jsonBody = JSON.parse(jsonBodyStr); - for (const key in jsonBody) { - arr.push(key); - map[key] = jsonBody[key]; - } - } -} -exports.TuyaAPIHelper = TuyaAPIHelper; -//# sourceMappingURL=TuyaAPIHelper.js.map \ No newline at end of file diff --git a/dist/lib/api/TuyaAPIHelper.js.map b/dist/lib/api/TuyaAPIHelper.js.map deleted file mode 100644 index 42a201c..0000000 --- a/dist/lib/api/TuyaAPIHelper.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TuyaAPIHelper.js","sourceRoot":"","sources":["../../../src/lib/api/TuyaAPIHelper.ts"],"names":[],"mappings":";;;;;;AAGA,0DAAiC;AACjC,sDAA8B;AAC9B,6BAA0B;AAE1B,MAAa,aAAa;IACtB,YAA4B,MAA2B,EAAE,GAAW;QAAxC,WAAM,GAAN,MAAM,CAAqB;QAQ/C,gBAAW,GAAG,EAAE,CAAC;QACjB,iBAAY,GAAG,EAAE,CAAC;QAClB,aAAQ,GAAG,EAAE,CAAC;QACd,iBAAY,GAAG,EAAE,CAAC;QAClB,YAAO,GAAG,EAAE,CAAC;QACb,cAAS,GAAW,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;QACzC,YAAO,GAAG,EAAE,CAAC;QAbjB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,eAAe,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,uBAAuB,MAAM,CAAC,YAAY,MAAM,CAAC;QAChE,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAaM,MAAM,CAAC,QAAQ,CAAC,MAA2B,E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AAG,MAAM,GAAG,IAAI,GAAG,UAAU,GAAG,IAAI,GAAG,GAAG,CAAC;QACzE,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC;QACjB,OAAO,GAAG,CAAC;IACf,CAAC;IAED,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG;QACtB,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACzC,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE;YACxB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACd,GAAG,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;SAC5B;IACL,CAAC;CAGJ;AA9aD,sCA8aC"} \ No newline at end of file diff --git a/dist/platform.js b/dist/platform.js index 6c8935f..bb69dec 100644 --- a/dist/platform.js +++ b/dist/platform.js @@ -128,7 +128,7 @@ class TuyaIRPlatform { } } //Remove accessories removed from config. - const accessoriesToRemove = this.accessories.filter(acc => foundAccessories.some(foundAccessory => foundAccessory.UUID !== acc.UUID)); + const accessoriesToRemove = this.accessories.filter(acc => !foundAccessories.some(foundAccessory => foundAccessory.UUID === acc.UUID)); this.log.info(`Removing ${accessoriesToRemove.length} accessories as they are no longer configured...`); this.api.unregisterPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, accessoriesToRemove); foundAccessories = []; diff --git a/dist/platform.js.map b/dist/platform.js.map index db3873f..1f7538f 100644 --- a/dist/platform.js.map +++ b/dist/platform.js.map @@ -1 +1 @@ -{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;;AACA,2DAAwD;AACxD,uFAAoF;AACpF,iEAA8D;AAC9D,yEAAsE;AACtE,mFAAgF;AAEhF,MAAM,aAAa,GAAG,QAAQ,CAAC;AAC/B,MAAM,WAAW,GAAG,oBAAoB,CAA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AI,CAAC,CAAC;4BAEpE,+DAA+D;4BAC/D,wFAAwF;4BACxF,SAAS,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;4BAClC,mCAAmC;4BAEnC,8DAA8D;4BAC9D,+CAA+C;4BAC/C,IAAI,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;4BAC/B,sCAAsC;4BACtC,IAAI,CAAC,GAAG,CAAC,2BAA2B,CAAC,WAAW,EAAE,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;yBAC/E;6BAAM;4BACL,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,0BAA0B,MAAM,CAAC,IAAI,MAAM,CAAC,CAAC;yBAC5D;qBAEF;iBACF;aACF;YACD,yCAAyC;YACzC,MAAM,mBAAmB,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,cAAc,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;YACvI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,mBAAmB,CAAC,MAAM,kDAAkD,CAAC,CAAC;YACxG,IAAI,CAAC,GAAG,CAAC,6BAA6B,CAAC,WAAW,EAAE,aAAa,EAAE,mBAAmB,CAAC,CAAC;YACxF,gBAAgB,GAAG,EAAE,CAAC;YACtB,CAAC,EAAE,CAAC;YACJ,IAAG,CAAC,GAAG,KAAK,EAAE;gBACZ,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;aAC/B;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAzID,wCAyIC"} \ No newline at end of file diff --git a/src/lib/accessories/AirConditionerAccessory.ts b/src/lib/accessories/AirConditionerAccessory.ts index 00442c3..c2b988e 100644 --- a/src/lib/accessories/AirConditionerAccessory.ts +++ b/src/lib/accessories/AirConditionerAccessory.ts @@ -40,10 +40,6 @@ export class AirConditionerAccessory extends BaseAccessory { .onSet(this.setHeatingCoolingState.bind(this)) .onGet(this.getHeatingCoolingState.bind(this)); - this.service.getCharacteristic(this.platform.Characteristic.TargetTemperature) - .onSet(this.setTargetTemperature.bind(this)) - .onGet(this.getTargetTemperature.bind(this)); - this.service.getCharacteristic(this.platform.Characteristic.CurrentTemperature) .onGet(this.getCurrentTemperature.bind(this)); @@ -103,23 +99,6 @@ export class AirConditionerAccessory extends BaseAccessory { return this.acStates.On; } - setTargetTemperature(value: CharacteristicValue) { - const command = value as number; - this.sendACCommand(this.parentId, this.accessory.context.device.id, "temp", command, (body) => { - if (!body.success) { - this.log.error(`Failed to change AC temperature due to error ${body.msg}`); - } else { - this.log.info(`${this.accessory.displayName} temperature is set to ${command} degrees.`); - this.acStates.temperature = command; - this.service.updateCharacteristic(this.platform.Characteristic.CurrentTemperature, command); - } - }); - } - - getTargetTemperature(): CharacteristicValue { - return this.acStates.temperature; - } - setHeatingCoolingState(value: CharacteristicValue) { const val = value as number; let command = 2; diff --git a/src/platform.ts b/src/platform.ts index a618cf2..6889bb5 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -145,7 +145,7 @@ export class TuyaIRPlatform implements DynamicPlatformPlugin { } } //Remove accessories removed from config. - const accessoriesToRemove = this.accessories.filter(acc => foundAccessories.some(foundAccessory => foundAccessory.UUID !== acc.UUID)); + const accessoriesToRemove = this.accessories.filter(acc => !foundAccessories.some(foundAccessory => foundAccessory.UUID === acc.UUID)); this.log.info(`Removing ${accessoriesToRemove.length} accessories as they are no longer configured...`); this.api.unregisterPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, accessoriesToRemove); foundAccessories = [];