diff --git a/index.js b/index.js index 5f920ad..d748f33 100644 --- a/index.js +++ b/index.js @@ -7031,6 +7031,7 @@ return this.__repr__(); if (_.isObject(self.vDev)) { self.vDev.off("change:metrics:level", self.onLevelChange); } + Base.prototype.remove.call(); }; CurrentTiltAngle.prototype.__repr__ = function __repr__ () { if(SlatSupport.prototype.__repr__) return SlatSupport.prototype.__repr__.call(this); @@ -10649,16 +10650,8 @@ return this.__repr__(); var ac, s; self.name = "Bridge4KT"; ac = Base.prototype.add_to.call(self, collection); - s = ac.addService("49FB9D4D-0FEA-4BF1-8FA6-E7B18AB86DCE", "Bridge4KT"); - s.addCharacteristic(HomeKit.Characteristics.State, "uint8", 0, ρσ_list_decorate([ "pr", "ev" ]), (function(){ - var ρσ_d = {}; - ρσ_d["maxValue"] = 1; - ρσ_d["minValue"] = 0; - ρσ_d["minStep"] = 1; - return ρσ_d; - }).call(this)); - s.addCharacteristic(HomeKit.Characteristics.Version, "string", "1.0", ρσ_list_decorate([ "pr", "ev" ])); - s.addCharacteristic(HomeKit.Characteristics.ControlPoint, "data", "", ρσ_list_decorate([ "pr", "pw", "ev" ])); + s = ac.addService(HomeKit.Services.HAPProtocolInformation, "Bridge4KT"); + s.addCharacteristic(HomeKit.Characteristics.Version, "string", "1.2", ρσ_list_decorate([ "pr", "ev" ])); return ac; }; if (!Main.prototype.add_to.__annotations__) Object.defineProperties(Main.prototype.add_to, { @@ -10906,9 +10899,9 @@ return this.__repr__(); function out() { var key; - var ρσ_Iter0 = ρσ_Iterable(arguments); - for (var ρσ_Index0 = 0; ρσ_Index0 < ρσ_Iter0.length; ρσ_Index0++) { - key = ρσ_Iter0[ρσ_Index0]; + var ρσ_Iter7 = ρσ_Iterable(arguments); + for (var ρσ_Index7 = 0; ρσ_Index7 < ρσ_Iter7.length; ρσ_Index7++) { + key = ρσ_Iter7[ρσ_Index7]; if (_.isObject(arguments[(typeof key === "number" && key < 0) ? arguments.length + key : key])) { arguments[(typeof key === "number" && key < 0) ? arguments.length + key : key] = JSON.stringify(arguments[(typeof key === "number" && key < 0) ? arguments.length + key : key]); } @@ -10947,14 +10940,14 @@ return this.__repr__(); if (!(typeof devices !== "undefined" && devices !== null) || len(devices) < 1) { return null; } - var ρσ_Iter1 = ρσ_Iterable(devices); - for (var ρσ_Index1 = 0; ρσ_Index1 < ρσ_Iter1.length; ρσ_Index1++) { - d = ρσ_Iter1[ρσ_Index1]; + var ρσ_Iter8 = ρσ_Iterable(devices); + for (var ρσ_Index8 = 0; ρσ_Index8 < ρσ_Iter8.length; ρσ_Index8++) { + d = ρσ_Iter8[ρσ_Index8]; device = devices[(typeof d === "number" && d < 0) ? devices.length + d : d]; tags = device.tags; - var ρσ_Iter2 = ρσ_Iterable(tags); - for (var ρσ_Index2 = 0; ρσ_Index2 < ρσ_Iter2.length; ρσ_Index2++) { - tag = ρσ_Iter2[ρσ_Index2]; + var ρσ_Iter9 = ρσ_Iterable(tags); + for (var ρσ_Index9 = 0; ρσ_Index9 < ρσ_Iter9.length; ρσ_Index9++) { + tag = ρσ_Iter9[ρσ_Index9]; t = str.split(tag, ":"); if (ρσ_equals(len(t), 1)) { if (!(typeof primary !== "undefined" && primary !== null)) { @@ -10990,9 +10983,9 @@ return this.__repr__(); } } if (len(skip) > 0) { - var ρσ_Iter3 = ρσ_Iterable(skip); - for (var ρσ_Index3 = 0; ρσ_Index3 < ρσ_Iter3.length; ρσ_Index3++) { - s = ρσ_Iter3[ρσ_Index3]; + var ρσ_Iter10 = ρσ_Iterable(skip); + for (var ρσ_Index10 = 0; ρσ_Index10 < ρσ_Iter10.length; ρσ_Index10++) { + s = ρσ_Iter10[ρσ_Index10]; if ((primary === s || typeof primary === "object" && ρσ_equals(primary, s))) { primary = null; } else { @@ -11053,9 +11046,9 @@ return this.__repr__(); definition = ρσ_list_decorate([ definition ]); } dd = ρσ_list_decorate([]); - var ρσ_Iter4 = ρσ_Iterable(definition); - for (var ρσ_Index4 = 0; ρσ_Index4 < ρσ_Iter4.length; ρσ_Index4++) { - d = ρσ_Iter4[ρσ_Index4]; + var ρσ_Iter11 = ρσ_Iterable(definition); + for (var ρσ_Index11 = 0; ρσ_Index11 < ρσ_Iter11.length; ρσ_Index11++) { + d = ρσ_Iter11[ρσ_Index11]; if ((d === "Sensor" || typeof d === "object" && ρσ_equals(d, "Sensor"))) { sensors = services.check_sensor_capabilities(self, pDev); if (sensors !== null) { @@ -11106,9 +11099,9 @@ return this.__repr__(); } zway = global["zway"]; config_text = ""; - var ρσ_Iter5 = ρσ_Iterable(self.devices); - for (var ρσ_Index5 = 0; ρσ_Index5 < ρσ_Iter5.length; ρσ_Index5++) { - id = ρσ_Iter5[ρσ_Index5]; + var ρσ_Iter12 = ρσ_Iterable(self.devices); + for (var ρσ_Index12 = 0; ρσ_Index12 < ρσ_Iter12.length; ρσ_Index12++) { + id = ρσ_Iter12[ρσ_Index12]; pDev = (ρσ_expr_temp = self.devices)[(typeof id === "number" && id < 0) ? ρσ_expr_temp.length + id : id]; data = (ρσ_expr_temp = zway.devices)[(typeof id === "number" && id < 0) ? ρσ_expr_temp.length + id : id].data; name = data.givenName.value || ""; @@ -11119,14 +11112,14 @@ return this.__repr__(); cc += ((len(cc) > 0) ? " / " : "") + pDev.hashedFingerprint; } l = ρσ_list_decorate([]); - var ρσ_Iter6 = ρσ_Iterable(pDev.vDevices); - for (var ρσ_Index6 = 0; ρσ_Index6 < ρσ_Iter6.length; ρσ_Index6++) { - d = ρσ_Iter6[ρσ_Index6]; + var ρσ_Iter13 = ρσ_Iterable(pDev.vDevices); + for (var ρσ_Index13 = 0; ρσ_Index13 < ρσ_Iter13.length; ρσ_Index13++) { + d = ρσ_Iter13[ρσ_Index13]; tags = (ρσ_expr_temp = pDev.vDevices)[(typeof d === "number" && d < 0) ? ρσ_expr_temp.length + d : d].tags; if ((typeof tags !== "undefined" && tags !== null)) { - var ρσ_Iter7 = ρσ_Iterable(tags); - for (var ρσ_Index7 = 0; ρσ_Index7 < ρσ_Iter7.length; ρσ_Index7++) { - tag = ρσ_Iter7[ρσ_Index7]; + var ρσ_Iter14 = ρσ_Iterable(tags); + for (var ρσ_Index14 = 0; ρσ_Index14 < ρσ_Iter14.length; ρσ_Index14++) { + tag = ρσ_Iter14[ρσ_Index14]; pos = l.indexOf(tag); if ((pos === -1 || typeof pos === "object" && ρσ_equals(pos, -1))) { l.push(tag); @@ -11264,9 +11257,9 @@ return this.__repr__(); return s; } else if ((r.method === "PUT" || typeof r.method === "object" && ρσ_equals(r.method, "PUT")) && (r.path === "/characteristics" || typeof r.path === "object" && ρσ_equals(r.path, "/characteristics")) && r.data && r.data.characteristics) { - var ρσ_Iter8 = ρσ_Iterable(r.data.characteristics); - for (var ρσ_Index8 = 0; ρσ_Index8 < ρσ_Iter8.length; ρσ_Index8++) { - c = ρσ_Iter8[ρσ_Index8]; + var ρσ_Iter15 = ρσ_Iterable(r.data.characteristics); + for (var ρσ_Index15 = 0; ρσ_Index15 < ρσ_Iter15.length; ρσ_Index15++) { + c = ρσ_Iter15[ρσ_Index15]; if (!_.isUndefined(c.value)) { characteristic = this.accessories.find(c.aid, c.iid); if (characteristic) { @@ -11282,9 +11275,9 @@ return this.__repr__(); } else if ((r.method === "GET" || typeof r.method === "object" && ρσ_equals(r.method, "GET")) && ρσ_equals(r.path.slice(0, 20), "/characteristics?id=")) { accessoriesCharacteristics = r.path.slice(20).split(","); characteristics = ρσ_list_decorate([]); - var ρσ_Iter9 = ρσ_Iterable(accessoriesCharacteristics); - for (var ρσ_Index9 = 0; ρσ_Index9 < ρσ_Iter9.length; ρσ_Index9++) { - ac = ρσ_Iter9[ρσ_Index9]; + var ρσ_Iter16 = ρσ_Iterable(accessoriesCharacteristics); + for (var ρσ_Index16 = 0; ρσ_Index16 < ρσ_Iter16.length; ρσ_Index16++) { + ac = ρσ_Iter16[ρσ_Index16]; item = (function() { var ρσ_Iter = ρσ_Iterable(ac.split(".")), ρσ_Result = [], i; for (var ρσ_Index = 0; ρσ_Index < ρσ_Iter.length; ρσ_Index++) { @@ -11381,9 +11374,9 @@ return this.__repr__(); self.controller.devices.off("created", self.onCreated); self.controller.devices.off("change:tags", self.onTags); self.controller.devices.off("change:metrics:title", self.hk.update); - var ρσ_Iter10 = ρσ_Iterable(self.devices); - for (var ρσ_Index10 = 0; ρσ_Index10 < ρσ_Iter10.length; ρσ_Index10++) { - id = ρσ_Iter10[ρσ_Index10]; + var ρσ_Iter17 = ρσ_Iterable(self.devices); + for (var ρσ_Index17 = 0; ρσ_Index17 < ρσ_Iter17.length; ρσ_Index17++) { + id = ρσ_Iter17[ρσ_Index17]; device = (ρσ_expr_temp = self.devices)[(typeof id === "number" && id < 0) ? ρσ_expr_temp.length + id : id]; ac = device.accessory; if ((typeof ac !== "undefined" && ac !== null)) { diff --git a/module.json b/module.json index aca64da..eedeeb0 100755 --- a/module.json +++ b/module.json @@ -5,9 +5,9 @@ "homepage": "https://github.com/ralphwetzel/bridge4kt", "icon": "house.png", "moduleName": "Bridge4KT", - "version": "1.1", - "serial": "20190223|133148", - "tick": 1550925108949, + "version": "1.2", + "serial": "20210507|222258", + "tick": 1620418978543, "maturity": "stable", "repository": { "type": "git", @@ -41,7 +41,8 @@ "options": { "fields": { "name": { - "label": "__l_options__" + "label": "__l_options__", + "helper": "Hint: If your bridge doesn't shop up in the Home app, try altering this label. Sometimes this helps..." }, "pin": { "label": "__l_pin__" diff --git a/source/bridge4kt/accessories.pyj b/source/bridge4kt/accessories.pyj index a03f268..2d20c79 100644 --- a/source/bridge4kt/accessories.pyj +++ b/source/bridge4kt/accessories.pyj @@ -89,10 +89,10 @@ class Main(Base): self.name = "Bridge4KT" ac = Base.add_to(self, collection) - s = ac.addService("49FB9D4D-0FEA-4BF1-8FA6-E7B18AB86DCE", "Bridge4KT") - s.addCharacteristic(HomeKit.Characteristics.State, "uint8" , 0, ["pr", "ev"], {"maxValue":1, "minValue":0, "minStep":1}) - s.addCharacteristic(HomeKit.Characteristics.Version, "string", "1.0", ["pr", "ev"]) - s.addCharacteristic(HomeKit.Characteristics.ControlPoint, "data", "", ["pr", "pw", "ev"]) + s = ac.addService(HomeKit.Services.HAPProtocolInformation, "Bridge4KT") + # s.addCharacteristic(HomeKit.Characteristics.State, "uint8" , 0, ["pr", "ev"], {"maxValue":1, "minValue":0, "minStep":1}) + s.addCharacteristic(HomeKit.Characteristics.Version, "string", "1.2", ["pr", "ev"]) + # s.addCharacteristic(HomeKit.Characteristics.ControlPoint, "data", "", ["pr", "pw", "ev"]) return ac diff --git a/source/bridge4kt/characteristics/motor.pyj b/source/bridge4kt/characteristics/motor.pyj index c18006d..175201a 100644 --- a/source/bridge4kt/characteristics/motor.pyj +++ b/source/bridge4kt/characteristics/motor.pyj @@ -314,6 +314,7 @@ class CurrentTiltAngle(SlatSupport): def remove(self): if _.isObject(self.vDev): self.vDev.off("change:metrics:level", self.onLevelChange) + Base.remove() class CurrentHorizontalTiltAngle(CurrentTiltAngle):