homebridge-tuya-plus 3.5.1 → 3.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -30,7 +30,7 @@ class CustomMultiOutletAccessory extends BaseAccessory {
|
|
|
30
30
|
throw new Error('The outlet definition #${i} is missing or is malformed: ' + outlet);
|
|
31
31
|
|
|
32
32
|
const name = ((outlet.name || '').trim() || 'Unnamed') + ' - ' + this.device.context.name;
|
|
33
|
-
let service = this.accessory.getServiceById(Service.Outlet
|
|
33
|
+
let service = this.accessory.getServiceById(Service.Outlet, 'outlet ' + outlet.dp);
|
|
34
34
|
if (service) this._checkServiceName(service, name);
|
|
35
35
|
else service = this.accessory.addService(Service.Outlet, name, 'outlet ' + outlet.dp);
|
|
36
36
|
|
|
@@ -24,7 +24,7 @@ class MultiOutletAccessory extends BaseAccessory {
|
|
|
24
24
|
const outletCount = parseInt(this.device.context.outletCount) || 1;
|
|
25
25
|
const _validServices = [];
|
|
26
26
|
for (let i = 0; i++ < outletCount;) {
|
|
27
|
-
let service = this.accessory.getServiceById(Service.Outlet
|
|
27
|
+
let service = this.accessory.getServiceById(Service.Outlet, 'outlet ' + i);
|
|
28
28
|
if (service) this._checkServiceName(service, this.device.context.name + ' ' + i);
|
|
29
29
|
else service = this.accessory.addService(Service.Outlet, this.device.context.name + ' ' + i, 'outlet ' + i);
|
|
30
30
|
|
|
@@ -34,12 +34,12 @@ class OilDiffuserAccessory extends BaseAccessory {
|
|
|
34
34
|
const {Service} = this.hap;
|
|
35
35
|
|
|
36
36
|
const humidifierName = this.device.context.name;
|
|
37
|
-
let humidifierService = this.accessory.getServiceById(Service.HumidifierDehumidifier
|
|
37
|
+
let humidifierService = this.accessory.getServiceById(Service.HumidifierDehumidifier, 'humidifier');
|
|
38
38
|
if (humidifierService) this._checkServiceName(humidifierService, humidifierName);
|
|
39
39
|
else humidifierService = this.accessory.addService(Service.HumidifierDehumidifier, humidifierName, 'humidifier');
|
|
40
40
|
|
|
41
41
|
const lightName = this.device.context.name + ' Light';
|
|
42
|
-
let lightService = this.accessory.getServiceById(Service.Lightbulb
|
|
42
|
+
let lightService = this.accessory.getServiceById(Service.Lightbulb, 'lightbulb');
|
|
43
43
|
if (lightService) this._checkServiceName(lightService, lightName);
|
|
44
44
|
else lightService = this.accessory.addService(Service.Lightbulb, lightName, 'lightbulb');
|
|
45
45
|
|
|
@@ -55,8 +55,8 @@ class OilDiffuserAccessory extends BaseAccessory {
|
|
|
55
55
|
|
|
56
56
|
const {Service, AdaptiveLightingController, Characteristic} = this.hap;
|
|
57
57
|
|
|
58
|
-
const humidifierService = this.accessory.getServiceById(Service.HumidifierDehumidifier
|
|
59
|
-
const lightService = this.accessory.getServiceById(Service.Lightbulb
|
|
58
|
+
const humidifierService = this.accessory.getServiceById(Service.HumidifierDehumidifier, 'humidifier');
|
|
59
|
+
const lightService = this.accessory.getServiceById(Service.Lightbulb, 'lightbulb');
|
|
60
60
|
|
|
61
61
|
this.dpLight = this._getCustomDP(this.device.context.dpLight) || '5';
|
|
62
62
|
this.dpMode = this._getCustomDP(this.device.context.dpMode) || '6';
|
|
@@ -22,12 +22,12 @@ class RGBTWOutletAccessory extends BaseAccessory {
|
|
|
22
22
|
const {Service} = this.hap;
|
|
23
23
|
|
|
24
24
|
const outletName = 'Outlet - ' + this.device.context.name;
|
|
25
|
-
let outletService = this.accessory.getServiceById(Service.Outlet
|
|
25
|
+
let outletService = this.accessory.getServiceById(Service.Outlet, 'outlet');
|
|
26
26
|
if (outletService) this._checkServiceName(outletService, outletName);
|
|
27
27
|
else outletService = this.accessory.addService(Service.Outlet, outletName, 'outlet');
|
|
28
28
|
|
|
29
29
|
const lightName = 'RGBTWLight - ' + this.device.context.name;
|
|
30
|
-
let lightService = this.accessory.getServiceById(Service.Lightbulb
|
|
30
|
+
let lightService = this.accessory.getServiceById(Service.Lightbulb, 'lightbulb');
|
|
31
31
|
if (lightService) this._checkServiceName(lightService, lightName);
|
|
32
32
|
else lightService = this.accessory.addService(Service.Lightbulb, lightName, 'lightbulb');
|
|
33
33
|
|
|
@@ -43,8 +43,8 @@ class RGBTWOutletAccessory extends BaseAccessory {
|
|
|
43
43
|
|
|
44
44
|
const {Service, Characteristic, EnergyCharacteristics} = this.hap;
|
|
45
45
|
|
|
46
|
-
const outletService = this.accessory.getServiceById(Service.Outlet
|
|
47
|
-
const lightService = this.accessory.getServiceById(Service.Lightbulb
|
|
46
|
+
const outletService = this.accessory.getServiceById(Service.Outlet, 'outlet');
|
|
47
|
+
const lightService = this.accessory.getServiceById(Service.Lightbulb, 'lightbulb');
|
|
48
48
|
|
|
49
49
|
this.dpLight = this._getCustomDP(this.device.context.dpLight) || '1';
|
|
50
50
|
this.dpMode = this._getCustomDP(this.device.context.dpMode) || '2';
|
package/lib/SwitchAccessory.js
CHANGED
|
@@ -24,7 +24,7 @@ class SwitchAccessory extends BaseAccessory {
|
|
|
24
24
|
const switchCount = parseInt(this.device.context.switchCount) || 1;
|
|
25
25
|
const _validServices = [];
|
|
26
26
|
for (let i = 0; i++ < switchCount;) {
|
|
27
|
-
let service = this.accessory.getServiceById(Service.Switch
|
|
27
|
+
let service = this.accessory.getServiceById(Service.Switch, 'switch ' + i);
|
|
28
28
|
if (service) this._checkServiceName(service, this.device.context.name + ' ' + i);
|
|
29
29
|
else service = this.accessory.addService(Service.Switch, this.device.context.name + ' ' + i, 'switch ' + i);
|
|
30
30
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-tuya-plus",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.2",
|
|
4
4
|
"description": "A community-maintained Homebridge plugin for controlling Tuya devices locally over LAN. Includes new features, fixes, and updated device support.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|