diff --git a/dist/lib/accessories/AirConditionerAccessory.d.ts.map b/dist/lib/accessories/AirConditionerAccessory.d.ts.map index 5107f57..12ac754 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;IAiDjD;;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 +{"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;IA+CjD;;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 f8f26e6..45371f3 100644 --- a/dist/lib/accessories/AirConditionerAccessory.js +++ b/dist/lib/accessories/AirConditionerAccessory.js @@ -34,8 +34,6 @@ class AirConditionerAccessory extends BaseAccessory_1.BaseAccessory { .onGet(this.getCurrentTemperature.bind(this)); this.service.getCharacteristic(this.platform.Characteristic.CoolingThresholdTemperature) .setProps({ - minValue: 16, - maxValue: 30, minStep: 1 }) .onGet(this.getCoolingThresholdTemperatureCharacteristic.bind(this)) @@ -43,7 +41,7 @@ class AirConditionerAccessory extends BaseAccessory_1.BaseAccessory { this.service.getCharacteristic(this.platform.Characteristic.HeatingThresholdTemperature) .onGet(this.getCoolingThresholdTemperatureCharacteristic.bind(this)) .onSet(this.setCoolingThresholdTemperatureCharacteristic.bind(this)) - .setProps({ unit: undefined, minValue: 17, maxValue: 30, minStep: 1, }); + .setProps({ minStep: 1 }); this.service.getCharacteristic(this.platform.Characteristic.RotationSpeed) .setProps({ unit: undefined, diff --git a/dist/lib/accessories/AirConditionerAccessory.js.map b/dist/lib/accessories/AirConditionerAccessory.js.map index 3100785..9bf352a 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,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAEpC,aAAQ,GAAG;YACf,EAAE,EAAE,KAAK;YACT,WAAW,EAAE,E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O,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;AA/KD,0DA+KC"} \ No newline at end of file diff --git a/dist/lib/accessories/DoItYourselfAccessory.d.ts.map b/dist/lib/accessories/DoItYourselfAccessory.d.ts.map index 2c8c696..aaf5b1b 100644 --- a/dist/lib/accessories/DoItYourselfAccessory.d.ts.map +++ b/dist/lib/accessories/DoItYourselfAccessory.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"DoItYourselfAccessory.d.ts","sourceRoot":"","sources":["../../../src/lib/accessories/DoItYourselfAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,aAAa;IAEhD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBADT,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,iBAAiB;IAkDjD,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAC,MAAM,EAAE,EAAE,KAAA;IAOpE,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAA;CAM5D"} \ No newline at end of file +{"version":3,"file":"DoItYourselfAccessory.d.ts","sourceRoot":"","sources":["../../../src/lib/accessories/DoItYourselfAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,aAAa;IAEhD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBADT,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,iBAAiB;IAkDjD,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAC,MAAM,EAAE,EAAE,KAAA;IAOpE,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAA;CAO5D"} \ No newline at end of file diff --git a/dist/lib/accessories/DoItYourselfAccessory.js b/dist/lib/accessories/DoItYourselfAccessory.js index bf8ee81..6901999 100644 --- a/dist/lib/accessories/DoItYourselfAccessory.js +++ b/dist/lib/accessories/DoItYourselfAccessory.js @@ -62,6 +62,7 @@ class DoItYourselfAccessory extends BaseAccessory_1.BaseAccessory { fetchLearningCodes(deviceId, remoteId, cb) { this.log.debug("Getting Learning Codes"); APIInvocationHelper_1.APIInvocationHelper.invokeTuyaIrApi(this.log, this.configuration, this.configuration.apiHost + `/v2.0/infrareds/${deviceId}/remotes/${remoteId}/learning-codes`, "GET", {}, (body) => { + this.log.debug(`Received learning codes ${JSON.stringify(body)}`); cb(body); }); } diff --git a/dist/lib/accessories/DoItYourselfAccessory.js.map b/dist/lib/accessories/DoItYourselfAccessory.js.map index 3017f5c..3efac15 100644 --- a/dist/lib/accessories/DoItYourselfAccessory.js.map +++ b/dist/lib/accessories/DoItYourselfAccessory.js.map @@ -1 +1 @@ -{"version":3,"file":"DoItYourselfAccessory.js","sourceRoot":"","sources":["../../../src/lib/accessories/DoItYourselfAccessory.ts"],"names":[],"mappings":";;;AAEA,oEAAiE;AACjE,mDAAgD;AAEhD;;;;GAIG;AACH,MAAa,qBAAsB,SAAQ,6BAAa;IACpD,Y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,CAAC,uBAAuB,CAAC,CAAC;QACxC,yCAAmB,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,GAAG,mBAAmB,QAAQ,YAAY,QAAQ,iBAAiB,EAAE,MAAM,EAAE,EAAC,IAAI,EAAC,EAAE,CAAC,IAAI,EAAE,EAAE;YACtL,EAAE,CAAC,IAAI,CAAC,CAAC;QACb,CAAC,CAAC,CAAC;IACP,CAAC;IAED,kBAAkB,CAAC,QAAgB,EAAE,QAAgB,EAAE,EAAE;QACrD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QACzC,yCAAmB,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,GAAG,mBAAmB,QAAQ,YAAY,QAAQ,iBAAiB,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;YACjL,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,2BAA2B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAClE,EAAE,CAAC,IAAI,CAAC,CAAC;QACb,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAnED,sDAmEC"} \ No newline at end of file diff --git a/dist/lib/accessories/FanAccessory.d.ts b/dist/lib/accessories/FanAccessory.d.ts index 9effed9..7983fba 100644 --- a/dist/lib/accessories/FanAccessory.d.ts +++ b/dist/lib/accessories/FanAccessory.d.ts @@ -27,5 +27,6 @@ export declare class FanAccessory extends BaseAccessory { private sendFanCommand; private getIRCodeFromKey; private getIRCodesFromAPIResponse; + private getStandardIRCodesFromAPIResponse; } //# sourceMappingURL=FanAccessory.d.ts.map \ No newline at end of file diff --git a/dist/lib/accessories/FanAccessory.d.ts.map b/dist/lib/accessories/FanAccessory.d.ts.map index c6ae79b..d480c47 100644 --- a/dist/lib/accessories/FanAccessory.d.ts.map +++ b/dist/lib/accessories/FanAccessory.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"FanAccessory.d.ts","sourceRoot":"","sources":["../../../src/lib/accessories/FanAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAuB,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,aAAa;IAiBvC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAjB9B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,cAAc,CAAS;IAE/B,OAAO,CAAC,SAAS,CAKf;IAEF,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,YAAY,CAAQ;gBAGP,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,iBAAiB;IAqCjD,OAAO,CAAC,KAAK;IAgBb,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,cAAc;IAmCtB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,yBAAyB;CAUpC"} \ No newline at end of file +{"version":3,"file":"FanAccessory.d.ts","sourceRoot":"","sources":["../../../src/lib/accessories/FanAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAuB,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,aAAa;IAiBvC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAjB9B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,cAAc,CAAS;IAE/B,OAAO,CAAC,SAAS,CAKf;IAEF,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,YAAY,CAAQ;gBAGP,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,iBAAiB;IAsCjD,OAAO,CAAC,KAAK;IAgBb,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,cAAc;IAmCtB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,yBAAyB;IAWjC,OAAO,CAAC,iCAAiC;CAU5C"} \ No newline at end of file diff --git a/dist/lib/accessories/FanAccessory.js b/dist/lib/accessories/FanAccessory.js index ccf2108..1c7a209 100644 --- a/dist/lib/accessories/FanAccessory.js +++ b/dist/lib/accessories/FanAccessory.js @@ -39,6 +39,7 @@ class FanAccessory extends BaseAccessory_1.BaseAccessory { .onGet(this.getSwingMode.bind(this)); this.getFanCommands(this.parentId, accessory.context.device.id, accessory.context.device.diy, (commands) => { if (commands) { + this.log.debug(`Setting DIY Commands for Fan as ${JSON.stringify(commands)}`); this.powerCommand = commands.power; this.speedCommand = commands.speed; this.swingCommand = commands.swing; @@ -106,7 +107,7 @@ class FanAccessory extends BaseAccessory_1.BaseAccessory { callback(this.getIRCodesFromAPIResponse(codesBody)); } else { - this.log.error("Failed to invoke API", codesBody.msg); + this.log.error("Failed to get codes for DIY Fan", codesBody.msg); callback(); } }); @@ -122,13 +123,13 @@ class FanAccessory extends BaseAccessory_1.BaseAccessory { callback(this.getIRCodesFromAPIResponse(codesBody)); } else { - this.log.error("Failed to invoke API", codesBody.msg); - callback(); + this.log.warn("Failed to get custom codes for fan. Trying to use standard codes...", codesBody.msg); + callback(this.getStandardIRCodesFromAPIResponse(body)); } }); } else { - this.log.error("Failed to invoke API", body.msg); + this.log.error("Failed to get fan key details", body.msg); callback(); } }); @@ -142,7 +143,7 @@ class FanAccessory extends BaseAccessory_1.BaseAccessory { } getIRCodeFromKey(item, key) { if (item.key_name === key) { - return item.key; + return item.key_id || item.key; } } getIRCodesFromAPIResponse(apiResponse) { @@ -155,6 +156,16 @@ class FanAccessory extends BaseAccessory_1.BaseAccessory { } return ret; } + getStandardIRCodesFromAPIResponse(apiResponse) { + const ret = { power: null, speed: null, swing: null }; + for (let i = 0; i < apiResponse.result.key_list.length; i++) { + const codeItem = apiResponse.result.key_list[i]; + ret.power = ret.power || this.getIRCodeFromKey(codeItem, "power"); + ret.speed = ret.speed || this.getIRCodeFromKey(codeItem, "fan_speed"); + ret.swing = ret.swing || this.getIRCodeFromKey(codeItem, "swing"); + } + return ret; + } } exports.FanAccessory = FanAccessory; //# sourceMappingURL=FanAccessory.js.map \ No newline at end of file diff --git a/dist/lib/accessories/FanAccessory.js.map b/dist/lib/accessories/FanAccessory.js.map index c15b89e..d80f1ac 100644 --- a/dist/lib/accessories/FanAccessory.js.map +++ b/dist/lib/accessories/FanAccessory.js.map @@ -1 +1 @@ -{"version":3,"file":"FanAccessory.js","sourceRoot":"","sources":["../../../src/lib/accessories/FanAccessory.ts"],"names":[],"mappings":";;;AAEA,mDAAgD;AAChD,oEAAiE;AAEjE;;;;GAIG;AACH,MAAa,YAAa,SAAQ,6BAAa;IAgB3C,YACqB,QAAwB,EACxB,SAA4B;;QAE7C,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAHV,aAAQ,GAAR,QAAQ,CAAgB;QACxB,cAAS,GAAT,SAAS,CA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;IACf,CAAC;CACJ;AAhLD,oCAgLC"} \ No newline at end of file diff --git a/dist/lib/api/APIInvocationHelper.js b/dist/lib/api/APIInvocationHelper.js index 39c5605..8ba9d6f 100644 --- a/dist/lib/api/APIInvocationHelper.js +++ b/dist/lib/api/APIInvocationHelper.js @@ -16,7 +16,7 @@ class APIInvocationHelper { return this.calculateSign(url, config, "GET", timestamp, false); } static invokeTuyaIrApi(log, config, endpoint, method, body, callback) { - log.debug(`Calling endpoint ${endpoint}`); + log.debug(`Calling endpoint ${endpoint} with payload ${JSON.stringify(body)}`); const timestamp = new Date().getTime(); const accessToken = LoginHelper_1.LoginHelper.Instance(config, log).getAccessToken(); const emptyBodyForGet = method === "GET" ? "" : JSON.stringify(body); diff --git a/dist/lib/api/APIInvocationHelper.js.map b/dist/lib/api/APIInvocationHelper.js.map index b46a4e3..1d7b7fd 100644 --- a/dist/lib/api/APIInvocationHelper.js.map +++ b/dist/lib/api/APIInvocationHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"APIInvocationHelper.js","sourceRoot":"","sources":["../../../src/lib/api/APIInvocationHelper.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAiC;AAEjC,kDAA4B;AAC5B,6BAA0B;AAE1B,+CAA4C;AAE5C,MAAa,mBAAmB;IACrB,MAAM,CAAC,oCAAoC,CAAC,GAAQ,EAAE,MAA2B,EAAE,SAAiB,EAAE,WAAmB;QAC5H,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;IAChF,CAAC;IAEM,MAAM,CAAC,uCAAuC,CAAC,GAAQ,EAAE,MAA2B,EAAE,SAAiB;QAC1G,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACpE,CAAC;IAEM,MAAM,CAAC,eAAe,CAAC,GAAW,EAAE,MAA2B,EAAE,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AQ,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;QACvF,MAAM,OAAO,GAAG,gBAAgB,CAAC,SAAS,CAAC;QAE3C,MAAM,GAAG,GAAG,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,GAAG,SAAS,GAAG,OAAO,CAAC;QACxI,YAAY,CAAC,OAAO,GAAG,mBAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC;QAC/F,OAAO,YAAY,CAAC;IACxB,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,GAAG,EAAE;QACrD,MAAM,MAAM,GAAG,mBAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACrC,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,GAAG,GAAG,KAAK,EAAE,GAAG,EAAE,GAAG,GAAG,KAAK,EAAE,CAAC;IAC1F,CAAC;CAGJ;AAzED,kDAyEC"} \ No newline at end of file diff --git a/dist/lib/api/DeviceConfigurationHelper.d.ts.map b/dist/lib/api/DeviceConfigurationHelper.d.ts.map index c1fcd3c..94666c8 100644 --- a/dist/lib/api/DeviceConfigurationHelper.d.ts.map +++ b/dist/lib/api/DeviceConfigurationHelper.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"DeviceConfigurationHelper.d.ts","sourceRoot":"","sources":["../../../src/lib/api/DeviceConfigurationHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,qBAAa,yBAA0B,SAAQ,UAAU;IAErD,OAAO,CAAC,MAAM,CAAC,SAAS,CAA4B;IAEpD,OAAO;WAIO,QAAQ,CAAC,MAAM,EAAE,mBAAmB,EAAE,GAAG,EAAE,MAAM;IAU/D,YAAY,CAAC,QAAQ,EAAE,MAAM;IAa7B,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,SAAS;IAqBjB,OAAO,CAAC,kBAAkB;CAY7B"} \ No newline at end of file +{"version":3,"file":"DeviceConfigurationHelper.d.ts","sourceRoot":"","sources":["../../../src/lib/api/DeviceConfigurationHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,qBAAa,yBAA0B,SAAQ,UAAU;IAErD,OAAO,CAAC,MAAM,CAAC,SAAS,CAA4B;IAEpD,OAAO;WAIO,QAAQ,CAAC,MAAM,EAAE,mBAAmB,EAAE,GAAG,EAAE,MAAM;IAU/D,YAAY,CAAC,QAAQ,EAAE,MAAM;IAa7B,OAAO,CAAC,WAAW;IAenB,OAAO,CAAC,SAAS;IAqBjB,OAAO,CAAC,kBAAkB;CAY7B"} \ No newline at end of file diff --git a/dist/lib/api/DeviceConfigurationHelper.js b/dist/lib/api/DeviceConfigurationHelper.js index bc6fb78..1e6a9ca 100644 --- a/dist/lib/api/DeviceConfigurationHelper.js +++ b/dist/lib/api/DeviceConfigurationHelper.js @@ -36,6 +36,7 @@ class DeviceConfigurationHelper extends BaseHelper_1.BaseHelper { const dev = this.config.configuredRemotes[i]; this.fetchRemoteDetails(dev.id, (device) => { device.config = this.config; + device.diy = dev.diy; devs.push(device); if (devs.length == this.config.configuredRemotes.length) { cb(devs); diff --git a/dist/lib/api/DeviceConfigurationHelper.js.map b/dist/lib/api/DeviceConfigurationHelper.js.map index c2f5095..b2e39a9 100644 --- a/dist/lib/api/DeviceConfigurationHelper.js.map +++ b/dist/lib/api/DeviceConfigurationHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"DeviceConfigurationHelper.js","sourceRoot":"","sources":["../../../src/lib/api/DeviceConfigurationHelper.ts"],"names":[],"mappings":";;;AAEA,+DAA4D;AAC5D,6CAA0C;AAE1C,MAAa,yBAA0B,SAAQ,uBAAU;IAIrD,YAAoB,MAA2B,EAAE,GAAW;QACxD,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,MAA2B,EAAE,GAAW;QAC3D,IAAG,IAAI,CAAC,SAAS,EAAE;YACf,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC;YAC/B,IAAI,CAAC,SAAS,CAAC,GAAG,GAAG,GAAG,CAAC;SAC5B;aAAM;YACH,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;SAC1C;QACD,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,YAAY,CAAC,QAAgB;QACzB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC3B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,uBAAuB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACrE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,0BAA0B,EAAE;gBACzC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;gBACvD,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;aAC7B;iBAAM;gBACH,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC;gBACzE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;aACrC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,WAAW,CAAC,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M,EAAE,EAAE;wBACzD,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;wBAC5B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;wBAClB,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;4BACnC,EAAE,CAAC,IAAI,CAAC,CAAC;yBACZ;oBACL,CAAC,CAAC,CAAA;iBACL;aACJ;iBAAM;gBACH,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAC;gBAC1E,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;aACxB;QACL,CAAC,CAAC,CAAA;IACN,CAAC;IAEO,kBAAkB,CAAC,EAAE,EAAE,QAAQ;QACnC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,iBAAiB,EAAE,EAAE,CAAC,CAAC;QACpD,yCAAmB,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,GAAG,iBAAiB,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;YACjH,IAAI,IAAI,CAAC,OAAO,EAAE;gBACd,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aACzB;iBAAM;gBACH,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,0CAA0C,GAAG,EAAE,CAAC,CAAC;gBAChE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,2BAA2B,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;gBACvD,QAAQ,CAAC,EAAE,CAAC,CAAC;aAChB;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AA9ED,8DA8EC"} \ No newline at end of file +{"version":3,"file":"DeviceConfigurationHelper.js","sourceRoot":"","sources":["../../../src/lib/api/DeviceConfigurationHelper.ts"],"names":[],"mappings":";;;AAEA,+DAA4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ClB,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;4BACnC,EAAE,CAAC,IAAI,CAAC,CAAC;yBACZ;oBACL,CAAC,CAAC,CAAA;iBACL;aACJ;iBAAM;gBACH,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAC;gBAC1E,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;aACxB;QACL,CAAC,CAAC,CAAA;IACN,CAAC;IAEO,kBAAkB,CAAC,EAAE,EAAE,QAAQ;QACnC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,iBAAiB,EAAE,EAAE,CAAC,CAAC;QACpD,yCAAmB,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,GAAG,iBAAiB,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;YACjH,IAAI,IAAI,CAAC,OAAO,EAAE;gBACd,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aACzB;iBAAM;gBACH,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,0CAA0C,GAAG,EAAE,CAAC,CAAC;gBAChE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,2BAA2B,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;gBACvD,QAAQ,CAAC,EAAE,CAAC,CAAC;aAChB;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AA/ED,8DA+EC"} \ No newline at end of file diff --git a/dist/platform.js b/dist/platform.js index 0d6d4a1..0a107ae 100644 --- a/dist/platform.js +++ b/dist/platform.js @@ -77,7 +77,7 @@ class TuyaIRPlatform { // something globally unique, but constant, for example, the device serial // number or MAC address device.ir_id = this.config.smartIR[index].deviceId; - const Accessory = CLASS_DEF[device.category] || GenericAccessory_1.GenericAccessory; + const Accessory = CLASS_DEF[device.category] || (device.diy ? DoItYourselfAccessory_1.DoItYourselfAccessory : GenericAccessory_1.GenericAccessory); const uuid = this.api.hap.uuid.generate(device.id); // see if an accessory with the same uuid has already been registered and restored from // the cached devices we stored in the `configureAccessory` method above diff --git a/dist/platform.js.map b/dist/platform.js.map index c5393d0..903395e 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,CAAC;AACzC,MAAM,SAAS,GAAG;IAChB,WAAW,EAAE,iDAAuB;IACpC,YAAY,EAAE,2BAAY;IAC1B,EAAE,EAAE,6CAAqB;CAC1B,CAAC;AAEF;;;;GAIG;AACH,MAAa,cAAc;IAWzB,YACkB,GAAW,EACX,MAAsB,EACtB,GAAQ;QAFR,QAAG,GAAH,GAAG,CAAQ;QACX,WAAM,GAAN,MAAM,CAAgB;QACtB,QAAG,GAAH,GAAG,CAAK;QAbV,YAAO,GAAmB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC;QAC/C,mBAAc,GAA0B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC;QAEpF,oDAAoD;QACpC,gBAAW,GAAwB,EAAE,CAAC;QACtD,8DAA8D;QACvD,sBAAiB,GAAkB,IAAI,GAAG,EAAE,CAAC;QACnC,qBAAgB,GAAwB,EAAE,CAAC;QAQ1D,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,iCAAiC,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAGpE,8FAA8F;QAC9F,4FAA4F;QAC5F,2FAA2F;QAC3F,yCAAyC;QACzC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,oBA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L,yCAAyC;gBACzC,MAAM,mBAAmB,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,cAAc,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;gBAC5I,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,mBAAmB,CAAC,MAAM,kDAAkD,CAAC,CAAC;gBACxG,IAAI,CAAC,GAAG,CAAC,6BAA6B,CAAC,WAAW,EAAE,aAAa,EAAE,mBAAmB,CAAC,CAAC;gBACxF,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;aAC/D;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA1ID,wCA0IC"} \ No newline at end of file diff --git a/src/lib/accessories/AirConditionerAccessory.ts b/src/lib/accessories/AirConditionerAccessory.ts index 6133728..9919800 100644 --- a/src/lib/accessories/AirConditionerAccessory.ts +++ b/src/lib/accessories/AirConditionerAccessory.ts @@ -45,8 +45,6 @@ export class AirConditionerAccessory extends BaseAccessory { this.service.getCharacteristic(this.platform.Characteristic.CoolingThresholdTemperature) .setProps({ - minValue: 16, - maxValue: 30, minStep: 1 }) .onGet(this.getCoolingThresholdTemperatureCharacteristic.bind(this)) @@ -55,7 +53,7 @@ export class AirConditionerAccessory extends BaseAccessory { this.service.getCharacteristic(this.platform.Characteristic.HeatingThresholdTemperature) .onGet(this.getCoolingThresholdTemperatureCharacteristic.bind(this)) .onSet(this.setCoolingThresholdTemperatureCharacteristic.bind(this)) - .setProps({ unit: undefined, minValue: 17, maxValue: 30, minStep: 1, }) + .setProps({ minStep: 1 }) this.service.getCharacteristic(this.platform.Characteristic.RotationSpeed) .setProps({ diff --git a/src/lib/accessories/DoItYourselfAccessory.ts b/src/lib/accessories/DoItYourselfAccessory.ts index accf734..3a8e0af 100644 --- a/src/lib/accessories/DoItYourselfAccessory.ts +++ b/src/lib/accessories/DoItYourselfAccessory.ts @@ -71,6 +71,7 @@ export class DoItYourselfAccessory extends BaseAccessory { fetchLearningCodes(deviceId: string, remoteId: string, cb){ this.log.debug("Getting Learning Codes"); APIInvocationHelper.invokeTuyaIrApi(this.log, this.configuration, this.configuration.apiHost + `/v2.0/infrareds/${deviceId}/remotes/${remoteId}/learning-codes`, "GET", {}, (body) => { + this.log.debug(`Received learning codes ${JSON.stringify(body)}`); cb(body); }); } diff --git a/src/lib/accessories/FanAccessory.ts b/src/lib/accessories/FanAccessory.ts index ce0991d..15b688e 100644 --- a/src/lib/accessories/FanAccessory.ts +++ b/src/lib/accessories/FanAccessory.ts @@ -54,6 +54,7 @@ export class FanAccessory extends BaseAccessory { this.getFanCommands(this.parentId, accessory.context.device.id, accessory.context.device.diy, (commands) => { if (commands) { + this.log.debug(`Setting DIY Commands for Fan as ${JSON.stringify(commands)}`) this.powerCommand = commands.power; this.speedCommand = commands.speed; this.swingCommand = commands.swing; @@ -123,7 +124,7 @@ export class FanAccessory extends BaseAccessory { this.log.debug("Received codes. Returning all available codes"); callback(this.getIRCodesFromAPIResponse(codesBody)); } else { - this.log.error("Failed to invoke API", codesBody.msg); + this.log.error("Failed to get codes for DIY Fan", codesBody.msg); callback(); } }); @@ -137,12 +138,12 @@ export class FanAccessory extends BaseAccessory { this.log.debug("Received codes. Returning all available codes"); callback(this.getIRCodesFromAPIResponse(codesBody)); } else { - this.log.error("Failed to invoke API", codesBody.msg); - callback(); + this.log.warn("Failed to get custom codes for fan. Trying to use standard codes...", codesBody.msg); + callback(this.getStandardIRCodesFromAPIResponse(body)); } }); } else { - this.log.error("Failed to invoke API", body.msg); + this.log.error("Failed to get fan key details", body.msg); callback(); } }); @@ -158,7 +159,7 @@ export class FanAccessory extends BaseAccessory { private getIRCodeFromKey(item, key: string) { if (item.key_name === key) { - return item.key; + return item.key_id || item.key; } } @@ -172,4 +173,15 @@ export class FanAccessory extends BaseAccessory { } return ret; } + + private getStandardIRCodesFromAPIResponse(apiResponse) { + const ret = { power: null, speed: null, swing: null }; + for (let i = 0; i < apiResponse.result.key_list.length; i++) { + const codeItem = apiResponse.result.key_list[i]; + ret.power = ret.power || this.getIRCodeFromKey(codeItem, "power"); + ret.speed = ret.speed || this.getIRCodeFromKey(codeItem, "fan_speed"); + ret.swing = ret.swing || this.getIRCodeFromKey(codeItem, "swing"); + } + return ret; + } } \ No newline at end of file diff --git a/src/lib/api/APIInvocationHelper.ts b/src/lib/api/APIInvocationHelper.ts index 01ec84b..6abdb41 100644 --- a/src/lib/api/APIInvocationHelper.ts +++ b/src/lib/api/APIInvocationHelper.ts @@ -15,7 +15,7 @@ export class APIInvocationHelper { } public static invokeTuyaIrApi(log: Logger, config: TuyaIRConfiguration, endpoint: string, method: string, body: object, callback) { - log.debug(`Calling endpoint ${endpoint}`); + log.debug(`Calling endpoint ${endpoint} with payload ${JSON.stringify(body)}`); const timestamp = new Date().getTime(); const accessToken = LoginHelper.Instance(config, log).getAccessToken(); const emptyBodyForGet = method === "GET"?"":JSON.stringify(body); diff --git a/src/lib/api/DeviceConfigurationHelper.ts b/src/lib/api/DeviceConfigurationHelper.ts index 7c5a164..e3b340d 100644 --- a/src/lib/api/DeviceConfigurationHelper.ts +++ b/src/lib/api/DeviceConfigurationHelper.ts @@ -40,6 +40,7 @@ export class DeviceConfigurationHelper extends BaseHelper { const dev = this.config.configuredRemotes[i]; this.fetchRemoteDetails(dev.id, (device) => { device.config = this.config; + device.diy = dev.diy; devs.push(device); if (devs.length == this.config.configuredRemotes.length) { cb(devs); diff --git a/src/platform.ts b/src/platform.ts index 9711c20..b65cabf 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -87,7 +87,7 @@ export class TuyaIRPlatform implements DynamicPlatformPlugin { // something globally unique, but constant, for example, the device serial // number or MAC address device.ir_id = this.config.smartIR[index].deviceId; - const Accessory = CLASS_DEF[device.category] || GenericAccessory; + const Accessory = CLASS_DEF[device.category] || (device.diy?DoItYourselfAccessory:GenericAccessory); const uuid = this.api.hap.uuid.generate(device.id); // see if an accessory with the same uuid has already been registered and restored from