@switchbot/homebridge-switchbot 1.7.1-beta.12 → 1.7.1-beta.13
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.
- package/dist/devices/bots.d.ts +1 -1
- package/dist/devices/bots.d.ts.map +1 -1
- package/dist/devices/bots.js +27 -24
- package/dist/devices/bots.js.map +1 -1
- package/dist/devices/colorbulb.d.ts.map +1 -1
- package/dist/devices/colorbulb.js +13 -10
- package/dist/devices/colorbulb.js.map +1 -1
- package/dist/devices/contact.d.ts +3 -3
- package/dist/devices/contact.d.ts.map +1 -1
- package/dist/devices/contact.js +38 -32
- package/dist/devices/contact.js.map +1 -1
- package/dist/devices/curtains.d.ts.map +1 -1
- package/dist/devices/curtains.js +13 -10
- package/dist/devices/curtains.js.map +1 -1
- package/dist/devices/humidifiers.d.ts.map +1 -1
- package/dist/devices/humidifiers.js +13 -10
- package/dist/devices/humidifiers.js.map +1 -1
- package/dist/devices/meters.d.ts +3 -3
- package/dist/devices/meters.d.ts.map +1 -1
- package/dist/devices/meters.js +42 -36
- package/dist/devices/meters.js.map +1 -1
- package/dist/devices/motion.d.ts +3 -3
- package/dist/devices/motion.d.ts.map +1 -1
- package/dist/devices/motion.js +38 -32
- package/dist/devices/motion.js.map +1 -1
- package/dist/devices/plugs.d.ts +3 -3
- package/dist/devices/plugs.d.ts.map +1 -1
- package/dist/devices/plugs.js +38 -32
- package/dist/devices/plugs.js.map +1 -1
- package/dist/irdevices/airconditioners.d.ts +1 -1
- package/dist/irdevices/airconditioners.d.ts.map +1 -1
- package/dist/irdevices/airconditioners.js +15 -14
- package/dist/irdevices/airconditioners.js.map +1 -1
- package/dist/irdevices/airpurifiers.d.ts +3 -3
- package/dist/irdevices/airpurifiers.d.ts.map +1 -1
- package/dist/irdevices/airpurifiers.js +19 -18
- package/dist/irdevices/airpurifiers.js.map +1 -1
- package/dist/irdevices/cameras.d.ts +1 -1
- package/dist/irdevices/cameras.d.ts.map +1 -1
- package/dist/irdevices/cameras.js +15 -14
- package/dist/irdevices/cameras.js.map +1 -1
- package/dist/irdevices/fans.d.ts +1 -1
- package/dist/irdevices/fans.d.ts.map +1 -1
- package/dist/irdevices/fans.js +15 -14
- package/dist/irdevices/fans.js.map +1 -1
- package/dist/irdevices/lights.d.ts +1 -1
- package/dist/irdevices/lights.d.ts.map +1 -1
- package/dist/irdevices/lights.js +15 -14
- package/dist/irdevices/lights.js.map +1 -1
- package/dist/irdevices/others.d.ts +2 -2
- package/dist/irdevices/others.d.ts.map +1 -1
- package/dist/irdevices/others.js +19 -18
- package/dist/irdevices/others.js.map +1 -1
- package/dist/irdevices/tvs.d.ts +1 -1
- package/dist/irdevices/tvs.d.ts.map +1 -1
- package/dist/irdevices/tvs.js +15 -14
- package/dist/irdevices/tvs.js.map +1 -1
- package/dist/irdevices/vacuumcleaners.d.ts +1 -1
- package/dist/irdevices/vacuumcleaners.d.ts.map +1 -1
- package/dist/irdevices/vacuumcleaners.js +15 -14
- package/dist/irdevices/vacuumcleaners.js.map +1 -1
- package/dist/irdevices/waterheaters.d.ts +1 -1
- package/dist/irdevices/waterheaters.d.ts.map +1 -1
- package/dist/irdevices/waterheaters.js +15 -14
- package/dist/irdevices/waterheaters.js.map +1 -1
- package/dist/settings.d.ts +6 -6
- package/dist/settings.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/devices/bots.ts +27 -24
- package/src/devices/colorbulb.ts +13 -10
- package/src/devices/contact.ts +38 -32
- package/src/devices/curtains.ts +13 -10
- package/src/devices/humidifiers.ts +13 -10
- package/src/devices/meters.ts +42 -36
- package/src/devices/motion.ts +38 -32
- package/src/devices/plugs.ts +38 -32
- package/src/irdevices/airconditioners.ts +15 -14
- package/src/irdevices/airpurifiers.ts +19 -18
- package/src/irdevices/cameras.ts +15 -14
- package/src/irdevices/fans.ts +15 -14
- package/src/irdevices/lights.ts +15 -14
- package/src/irdevices/others.ts +19 -18
- package/src/irdevices/tvs.ts +15 -14
- package/src/irdevices/vacuumcleaners.ts +15 -14
- package/src/irdevices/waterheaters.ts +15 -14
- package/src/settings.ts +6 -6
package/src/devices/plugs.ts
CHANGED
|
@@ -33,9 +33,9 @@ export class Plug {
|
|
|
33
33
|
public device: device & devicesConfig,
|
|
34
34
|
) {
|
|
35
35
|
// default placeholders
|
|
36
|
-
this.logs();
|
|
37
|
-
this.scan();
|
|
38
|
-
this.refreshRate();
|
|
36
|
+
this.logs(device);
|
|
37
|
+
this.scan(device);
|
|
38
|
+
this.refreshRate(device);
|
|
39
39
|
this.config(device);
|
|
40
40
|
if (this.On === undefined) {
|
|
41
41
|
this.On = false;
|
|
@@ -119,55 +119,61 @@ export class Plug {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
config(device: device & devicesConfig) {
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
const config: any = device.plug;
|
|
123
|
+
if (device.ble !== undefined) {
|
|
124
|
+
config['ble'] = device.ble;
|
|
125
|
+
}
|
|
126
|
+
if (device.logging !== undefined) {
|
|
127
|
+
config['logging'] = device.logging;
|
|
128
|
+
}
|
|
129
|
+
if (device.refreshRate !== undefined) {
|
|
130
|
+
config['refreshRate'] = device.refreshRate;
|
|
131
|
+
}
|
|
132
|
+
if (device.scanDuration !== undefined) {
|
|
133
|
+
config['scanDuration'] = device.scanDuration;
|
|
134
|
+
}
|
|
135
|
+
if (config !== undefined) {
|
|
136
|
+
this.warnLog(`Plug: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
124
137
|
}
|
|
125
138
|
}
|
|
126
139
|
|
|
127
|
-
refreshRate() {
|
|
128
|
-
if (
|
|
129
|
-
this.deviceRefreshRate = this.accessory.context.refreshRate =
|
|
130
|
-
|
|
131
|
-
this.warnLog(`Plug: ${this.accessory.displayName} Using Device Config refreshRate: ${this.deviceRefreshRate}`);
|
|
132
|
-
}
|
|
140
|
+
refreshRate(device: device & devicesConfig) {
|
|
141
|
+
if (device.refreshRate) {
|
|
142
|
+
this.deviceRefreshRate = this.accessory.context.refreshRate = device.refreshRate;
|
|
143
|
+
this.debugLog(`Plug: ${this.accessory.displayName} Using Device Config refreshRate: ${this.deviceRefreshRate}`);
|
|
133
144
|
} else if (this.platform.config.options!.refreshRate) {
|
|
134
145
|
this.deviceRefreshRate = this.accessory.context.refreshRate = this.platform.config.options!.refreshRate;
|
|
135
|
-
|
|
136
|
-
this.warnLog(`Plug: ${this.accessory.displayName} Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
|
|
137
|
-
}
|
|
146
|
+
this.debugLog(`Plug: ${this.accessory.displayName} Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
|
|
138
147
|
}
|
|
139
148
|
}
|
|
140
149
|
|
|
141
|
-
scan() {
|
|
142
|
-
if (
|
|
143
|
-
this.scanDuration = this.accessory.context.scanDuration =
|
|
144
|
-
if (
|
|
145
|
-
this.
|
|
150
|
+
scan(device: device & devicesConfig) {
|
|
151
|
+
if (device.scanDuration) {
|
|
152
|
+
this.scanDuration = this.accessory.context.scanDuration = device.scanDuration;
|
|
153
|
+
if (device.ble) {
|
|
154
|
+
this.debugLog(`Plug: ${this.accessory.displayName} Using Device Config scanDuration: ${this.scanDuration}`);
|
|
146
155
|
}
|
|
147
156
|
} else {
|
|
148
157
|
this.scanDuration = this.accessory.context.scanDuration = 1;
|
|
149
|
-
if (this.
|
|
150
|
-
this.
|
|
158
|
+
if (this.device.ble) {
|
|
159
|
+
this.debugLog(`Plug: ${this.accessory.displayName} Using Default scanDuration: ${this.scanDuration}`);
|
|
151
160
|
}
|
|
152
161
|
}
|
|
153
162
|
}
|
|
154
163
|
|
|
155
|
-
logs() {
|
|
164
|
+
logs(device: device & devicesConfig) {
|
|
156
165
|
if (this.platform.debugMode) {
|
|
157
|
-
this.deviceLogging = this.accessory.context.logging = '
|
|
158
|
-
this.
|
|
159
|
-
} else if (
|
|
160
|
-
this.deviceLogging = this.accessory.context.logging =
|
|
161
|
-
|
|
162
|
-
this.warnLog(`Plug: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
163
|
-
}
|
|
166
|
+
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
167
|
+
this.debugLog(`Plug: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
168
|
+
} else if (device.logging) {
|
|
169
|
+
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
170
|
+
this.debugLog(`Plug: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
164
171
|
} else if (this.platform.config.options?.logging) {
|
|
165
172
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
166
|
-
|
|
167
|
-
this.warnLog(`Plug: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
168
|
-
}
|
|
173
|
+
this.debugLog(`Plug: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
169
174
|
} else {
|
|
170
175
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
176
|
+
this.debugLog(`Plug: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
171
177
|
}
|
|
172
178
|
}
|
|
173
179
|
|
|
@@ -49,7 +49,7 @@ export class AirConditioner {
|
|
|
49
49
|
public device: irdevice & irDevicesConfig,
|
|
50
50
|
) {
|
|
51
51
|
// default placeholders
|
|
52
|
-
this.logs();
|
|
52
|
+
this.logs(device);
|
|
53
53
|
this.config(device);
|
|
54
54
|
if (this.Active === undefined) {
|
|
55
55
|
this.Active = this.platform.Characteristic.Active.INACTIVE;
|
|
@@ -168,27 +168,28 @@ export class AirConditioner {
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
config(device: irdevice & irDevicesConfig) {
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
const config: any = device.irair;
|
|
172
|
+
if (device.logging !== undefined) {
|
|
173
|
+
config['logging'] = device.logging;
|
|
174
|
+
}
|
|
175
|
+
if (config !== undefined) {
|
|
176
|
+
this.warnLog(`Air Conditioner: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
173
177
|
}
|
|
174
178
|
}
|
|
175
179
|
|
|
176
|
-
logs() {
|
|
180
|
+
logs(device: irdevice & irDevicesConfig) {
|
|
177
181
|
if (this.platform.debugMode) {
|
|
178
|
-
this.deviceLogging = this.accessory.context.logging = '
|
|
179
|
-
this.
|
|
180
|
-
} else if (
|
|
181
|
-
this.deviceLogging = this.accessory.context.logging =
|
|
182
|
-
|
|
183
|
-
this.warnLog(`Air Conditioner: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
184
|
-
}
|
|
182
|
+
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
183
|
+
this.debugLog(`Air Conditioner: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
184
|
+
} else if (device.logging) {
|
|
185
|
+
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
186
|
+
this.debugLog(`Air Conditioner: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
185
187
|
} else if (this.platform.config.options?.logging) {
|
|
186
188
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
187
|
-
|
|
188
|
-
this.warnLog(`Air Conditioner: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
189
|
-
}
|
|
189
|
+
this.debugLog(`Air Conditioner: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
190
190
|
} else {
|
|
191
191
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
192
|
+
this.debugLog(`Air Conditioner: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
195
|
|
|
@@ -44,7 +44,7 @@ export class AirPurifier {
|
|
|
44
44
|
public device: irdevice & irDevicesConfig,
|
|
45
45
|
) {
|
|
46
46
|
// default placeholders
|
|
47
|
-
this.logs();
|
|
47
|
+
this.logs(device);
|
|
48
48
|
this.config(device);
|
|
49
49
|
if (this.Active === undefined) {
|
|
50
50
|
this.Active = this.platform.Characteristic.Active.INACTIVE;
|
|
@@ -89,36 +89,37 @@ export class AirPurifier {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
config(device: irdevice & irDevicesConfig) {
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
const config: any = device.irpur;
|
|
93
|
+
if (device.logging !== undefined) {
|
|
94
|
+
config['logging'] = device.logging;
|
|
95
|
+
}
|
|
96
|
+
if (config !== undefined) {
|
|
97
|
+
this.warnLog(`Air Purifier: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
94
98
|
}
|
|
95
99
|
}
|
|
96
100
|
|
|
97
|
-
logs() {
|
|
101
|
+
logs(device: irdevice & irDevicesConfig) {
|
|
98
102
|
if (this.platform.debugMode) {
|
|
99
|
-
this.deviceLogging = this.accessory.context.logging = '
|
|
100
|
-
this.
|
|
101
|
-
} else if (
|
|
102
|
-
this.deviceLogging = this.accessory.context.logging =
|
|
103
|
-
|
|
104
|
-
this.warnLog(`Air Purifier: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
105
|
-
}
|
|
103
|
+
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
104
|
+
this.debugLog(`Air Purifier: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
105
|
+
} else if (device.logging) {
|
|
106
|
+
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
107
|
+
this.debugLog(`Air Purifier: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
106
108
|
} else if (this.platform.config.options?.logging) {
|
|
107
109
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
108
|
-
|
|
109
|
-
this.warnLog(`Air Purifier: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
110
|
-
}
|
|
110
|
+
this.debugLog(`Air Purifier: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
111
111
|
} else {
|
|
112
112
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
113
|
+
this.debugLog(`Air Purifier: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
private ActiveSet(value: CharacteristicValue) {
|
|
117
118
|
this.debugLog(`Air Purifier: ${this.accessory.displayName} Set Active: ${value}`);
|
|
118
119
|
if (value === this.platform.Characteristic.Active.INACTIVE) {
|
|
119
|
-
this.
|
|
120
|
+
this.pushAirPurifierOffChanges();
|
|
120
121
|
} else {
|
|
121
|
-
this.
|
|
122
|
+
this.pushAirPurifierOnChanges();
|
|
122
123
|
}
|
|
123
124
|
this.Active = value;
|
|
124
125
|
this.ActiveCached = this.Active;
|
|
@@ -184,7 +185,7 @@ export class AirPurifier {
|
|
|
184
185
|
* AirPurifier: "command" "middleSpeed" "default" = fan speed to medium
|
|
185
186
|
* AirPurifier: "command" "highSpeed" "default" = fan speed to high
|
|
186
187
|
*/
|
|
187
|
-
async
|
|
188
|
+
async pushAirPurifierOnChanges() {
|
|
188
189
|
if (this.Active !== 1) {
|
|
189
190
|
const payload = {
|
|
190
191
|
commandType: 'command',
|
|
@@ -195,7 +196,7 @@ export class AirPurifier {
|
|
|
195
196
|
}
|
|
196
197
|
}
|
|
197
198
|
|
|
198
|
-
async
|
|
199
|
+
async pushAirPurifierOffChanges() {
|
|
199
200
|
if (this.Active !== 0) {
|
|
200
201
|
const payload = {
|
|
201
202
|
commandType: 'command',
|
package/src/irdevices/cameras.ts
CHANGED
|
@@ -25,7 +25,7 @@ export class Camera {
|
|
|
25
25
|
public device: irdevice & irDevicesConfig,
|
|
26
26
|
) {
|
|
27
27
|
// default placeholders
|
|
28
|
-
this.logs();
|
|
28
|
+
this.logs(device);
|
|
29
29
|
this.config(device);
|
|
30
30
|
if (this.On === undefined) {
|
|
31
31
|
this.On = false;
|
|
@@ -59,27 +59,28 @@ export class Camera {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
config(device: irdevice & irDevicesConfig) {
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
const config: any = device.ircam;
|
|
63
|
+
if (device.logging !== undefined) {
|
|
64
|
+
config['logging'] = device.logging;
|
|
65
|
+
}
|
|
66
|
+
if (config !== undefined) {
|
|
67
|
+
this.warnLog(`Camera: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
64
68
|
}
|
|
65
69
|
}
|
|
66
70
|
|
|
67
|
-
logs() {
|
|
71
|
+
logs(device: irdevice & irDevicesConfig) {
|
|
68
72
|
if (this.platform.debugMode) {
|
|
69
|
-
this.deviceLogging = this.accessory.context.logging = '
|
|
70
|
-
this.
|
|
71
|
-
} else if (
|
|
72
|
-
this.deviceLogging = this.accessory.context.logging =
|
|
73
|
-
|
|
74
|
-
this.warnLog(`Camera: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
75
|
-
}
|
|
73
|
+
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
74
|
+
this.debugLog(`Camera: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
75
|
+
} else if (device.logging) {
|
|
76
|
+
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
77
|
+
this.debugLog(`Camera: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
76
78
|
} else if (this.platform.config.options?.logging) {
|
|
77
79
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
78
|
-
|
|
79
|
-
this.warnLog(`Camera: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
80
|
-
}
|
|
80
|
+
this.debugLog(`Camera: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
81
81
|
} else {
|
|
82
82
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
83
|
+
this.debugLog(`Camera: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
|
package/src/irdevices/fans.ts
CHANGED
|
@@ -35,7 +35,7 @@ export class Fan {
|
|
|
35
35
|
public device: irdevice & irDevicesConfig,
|
|
36
36
|
) {
|
|
37
37
|
// default placeholders
|
|
38
|
-
this.logs();
|
|
38
|
+
this.logs(device);
|
|
39
39
|
this.config(device);
|
|
40
40
|
if (this.Active === undefined) {
|
|
41
41
|
this.Active = this.platform.Characteristic.Active.INACTIVE;
|
|
@@ -118,27 +118,28 @@ export class Fan {
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
config(device: irdevice & irDevicesConfig) {
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
const config: any = device.irfan;
|
|
122
|
+
if (device.logging !== undefined) {
|
|
123
|
+
config['logging'] = device.logging;
|
|
124
|
+
}
|
|
125
|
+
if (config !== undefined) {
|
|
126
|
+
this.warnLog(`Fan: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
123
127
|
}
|
|
124
128
|
}
|
|
125
129
|
|
|
126
|
-
logs() {
|
|
130
|
+
logs(device: irdevice & irDevicesConfig) {
|
|
127
131
|
if (this.platform.debugMode) {
|
|
128
|
-
this.deviceLogging = this.accessory.context.logging = '
|
|
129
|
-
this.
|
|
130
|
-
} else if (
|
|
131
|
-
this.deviceLogging = this.accessory.context.logging =
|
|
132
|
-
|
|
133
|
-
this.warnLog(`Fan: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
134
|
-
}
|
|
132
|
+
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
133
|
+
this.debugLog(`Fan: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
134
|
+
} else if (device.logging) {
|
|
135
|
+
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
136
|
+
this.debugLog(`Fan: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
135
137
|
} else if (this.platform.config.options?.logging) {
|
|
136
138
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
137
|
-
|
|
138
|
-
this.warnLog(`Fan: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
139
|
-
}
|
|
139
|
+
this.debugLog(`Fan: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
140
140
|
} else {
|
|
141
141
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
142
|
+
this.debugLog(`Fan: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
145
|
|
package/src/irdevices/lights.ts
CHANGED
|
@@ -25,7 +25,7 @@ export class Light {
|
|
|
25
25
|
public device: irdevice & irDevicesConfig,
|
|
26
26
|
) {
|
|
27
27
|
// default placeholders
|
|
28
|
-
this.logs();
|
|
28
|
+
this.logs(device);
|
|
29
29
|
this.config(device);
|
|
30
30
|
if (this.On === undefined) {
|
|
31
31
|
this.On = false;
|
|
@@ -74,27 +74,28 @@ export class Light {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
config(device: irdevice & irDevicesConfig) {
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
const config: any = device.irlight;
|
|
78
|
+
if (device.logging !== undefined) {
|
|
79
|
+
config['logging'] = device.logging;
|
|
80
|
+
}
|
|
81
|
+
if (config !== undefined) {
|
|
82
|
+
this.warnLog(`Light: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
85
|
|
|
82
|
-
logs() {
|
|
86
|
+
logs(device: irdevice & irDevicesConfig) {
|
|
83
87
|
if (this.platform.debugMode) {
|
|
84
|
-
this.deviceLogging = this.accessory.context.logging = '
|
|
85
|
-
this.
|
|
86
|
-
} else if (
|
|
87
|
-
this.deviceLogging = this.accessory.context.logging =
|
|
88
|
-
|
|
89
|
-
this.warnLog(`Light: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
90
|
-
}
|
|
88
|
+
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
89
|
+
this.debugLog(`Light: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
90
|
+
} else if (device.logging) {
|
|
91
|
+
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
92
|
+
this.debugLog(`Light: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
91
93
|
} else if (this.platform.config.options?.logging) {
|
|
92
94
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
93
|
-
|
|
94
|
-
this.warnLog(`Light: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
95
|
-
}
|
|
95
|
+
this.debugLog(`Light: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
96
96
|
} else {
|
|
97
97
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
98
|
+
this.debugLog(`Light: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
|
package/src/irdevices/others.ts
CHANGED
|
@@ -26,8 +26,8 @@ export class Others {
|
|
|
26
26
|
public device: irdevice & irDevicesConfig,
|
|
27
27
|
) {
|
|
28
28
|
// default placeholders
|
|
29
|
-
this.logs();
|
|
30
|
-
this.deviceType();
|
|
29
|
+
this.logs(device);
|
|
30
|
+
this.deviceType(device);
|
|
31
31
|
this.config(device);
|
|
32
32
|
if (this.Active === undefined) {
|
|
33
33
|
this.Active = this.platform.Characteristic.Active.INACTIVE;
|
|
@@ -66,9 +66,9 @@ export class Others {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
deviceType() {
|
|
70
|
-
if (
|
|
71
|
-
this.otherDeviceType = this.accessory.context.deviceType =
|
|
69
|
+
deviceType(device: irdevice & irDevicesConfig) {
|
|
70
|
+
if (device.other?.deviceType) {
|
|
71
|
+
this.otherDeviceType = this.accessory.context.deviceType = device.other.deviceType;
|
|
72
72
|
if (this.deviceLogging === 'debug' || this.deviceLogging === 'standard') {
|
|
73
73
|
this.warnLog(`Other: ${this.accessory.displayName} Using Device Type: ${this.otherDeviceType}`);
|
|
74
74
|
}
|
|
@@ -78,27 +78,28 @@ export class Others {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
config(device: irdevice & irDevicesConfig) {
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
const config: any = device.other;
|
|
82
|
+
if (device.logging !== undefined) {
|
|
83
|
+
config['logging'] = device.logging;
|
|
84
|
+
}
|
|
85
|
+
if (config !== undefined) {
|
|
86
|
+
this.warnLog(`Other: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
83
87
|
}
|
|
84
88
|
}
|
|
85
89
|
|
|
86
|
-
logs() {
|
|
90
|
+
logs(device: irdevice & irDevicesConfig) {
|
|
87
91
|
if (this.platform.debugMode) {
|
|
88
|
-
this.deviceLogging = this.accessory.context.logging = '
|
|
89
|
-
this.
|
|
90
|
-
} else if (
|
|
91
|
-
this.deviceLogging = this.accessory.context.logging =
|
|
92
|
-
|
|
93
|
-
this.warnLog(`Other: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
94
|
-
}
|
|
92
|
+
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
93
|
+
this.debugLog(`Other: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
94
|
+
} else if (device.logging) {
|
|
95
|
+
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
96
|
+
this.debugLog(`Other: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
95
97
|
} else if (this.platform.config.options?.logging) {
|
|
96
98
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
97
|
-
|
|
98
|
-
this.warnLog(`Other: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
99
|
-
}
|
|
99
|
+
this.debugLog(`Other: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
100
100
|
} else {
|
|
101
101
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
102
|
+
this.debugLog(`Other: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
|
package/src/irdevices/tvs.ts
CHANGED
|
@@ -30,7 +30,7 @@ export class TV {
|
|
|
30
30
|
public device: irdevice & irDevicesConfig,
|
|
31
31
|
) {
|
|
32
32
|
// default placeholders
|
|
33
|
-
this.logs();
|
|
33
|
+
this.logs(device);
|
|
34
34
|
this.config(device);
|
|
35
35
|
if (this.Active === undefined) {
|
|
36
36
|
this.Active = this.platform.Characteristic.Active.INACTIVE;
|
|
@@ -130,27 +130,28 @@ export class TV {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
config(device: irdevice & irDevicesConfig) {
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
const config: any = device.irtv;
|
|
134
|
+
if (device.logging !== undefined) {
|
|
135
|
+
config['logging'] = device.logging;
|
|
136
|
+
}
|
|
137
|
+
if (config !== undefined) {
|
|
138
|
+
this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
135
139
|
}
|
|
136
140
|
}
|
|
137
141
|
|
|
138
|
-
logs() {
|
|
142
|
+
logs(device: irdevice & irDevicesConfig) {
|
|
139
143
|
if (this.platform.debugMode) {
|
|
140
|
-
this.deviceLogging = this.accessory.context.logging = '
|
|
141
|
-
this.
|
|
142
|
-
} else if (
|
|
143
|
-
this.deviceLogging = this.accessory.context.logging =
|
|
144
|
-
|
|
145
|
-
this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
146
|
-
}
|
|
144
|
+
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
145
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
146
|
+
} else if (device.logging) {
|
|
147
|
+
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
148
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
147
149
|
} else if (this.platform.config.options?.logging) {
|
|
148
150
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
149
|
-
|
|
150
|
-
this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
151
|
-
}
|
|
151
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
152
152
|
} else {
|
|
153
153
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
154
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
154
155
|
}
|
|
155
156
|
}
|
|
156
157
|
|
|
@@ -25,7 +25,7 @@ export class VacuumCleaner {
|
|
|
25
25
|
public device: irdevice & irDevicesConfig,
|
|
26
26
|
) {
|
|
27
27
|
// default placeholders
|
|
28
|
-
this.logs();
|
|
28
|
+
this.logs(device);
|
|
29
29
|
this.config(device);
|
|
30
30
|
if (this.On === undefined) {
|
|
31
31
|
this.On = false;
|
|
@@ -59,27 +59,28 @@ export class VacuumCleaner {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
config(device: irdevice & irDevicesConfig) {
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
const config: any = device.irvc;
|
|
63
|
+
if (device.logging !== undefined) {
|
|
64
|
+
config['logging'] = device.logging;
|
|
65
|
+
}
|
|
66
|
+
if (config !== undefined) {
|
|
67
|
+
this.warnLog(`Vacuum Cleaner: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
64
68
|
}
|
|
65
69
|
}
|
|
66
70
|
|
|
67
|
-
logs() {
|
|
71
|
+
logs(device: irdevice & irDevicesConfig) {
|
|
68
72
|
if (this.platform.debugMode) {
|
|
69
|
-
this.deviceLogging = this.accessory.context.logging = '
|
|
70
|
-
this.
|
|
71
|
-
} else if (
|
|
72
|
-
this.deviceLogging = this.accessory.context.logging =
|
|
73
|
-
|
|
74
|
-
this.warnLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
75
|
-
}
|
|
73
|
+
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
74
|
+
this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
75
|
+
} else if (device.logging) {
|
|
76
|
+
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
77
|
+
this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
76
78
|
} else if (this.platform.config.options?.logging) {
|
|
77
79
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
78
|
-
|
|
79
|
-
this.warnLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
80
|
-
}
|
|
80
|
+
this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
81
81
|
} else {
|
|
82
82
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
83
|
+
this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
|
|
@@ -25,7 +25,7 @@ export class WaterHeater {
|
|
|
25
25
|
public device: irdevice & irDevicesConfig,
|
|
26
26
|
) {
|
|
27
27
|
// default placeholders
|
|
28
|
-
this.logs();
|
|
28
|
+
this.logs(device);
|
|
29
29
|
this.config(device);
|
|
30
30
|
if (this.Active === undefined) {
|
|
31
31
|
this.Active = this.platform.Characteristic.Active.INACTIVE;
|
|
@@ -68,27 +68,28 @@ export class WaterHeater {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
config(device: irdevice & irDevicesConfig) {
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
const config: any = device.irwh;
|
|
72
|
+
if (device.logging !== undefined) {
|
|
73
|
+
config['logging'] = device.logging;
|
|
74
|
+
}
|
|
75
|
+
if (config !== undefined) {
|
|
76
|
+
this.warnLog(`Water Heater: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
73
77
|
}
|
|
74
78
|
}
|
|
75
79
|
|
|
76
|
-
logs() {
|
|
80
|
+
logs(device: irdevice & irDevicesConfig) {
|
|
77
81
|
if (this.platform.debugMode) {
|
|
78
|
-
this.deviceLogging = this.accessory.context.logging = '
|
|
79
|
-
this.
|
|
80
|
-
} else if (
|
|
81
|
-
this.deviceLogging = this.accessory.context.logging =
|
|
82
|
-
|
|
83
|
-
this.warnLog(`Water Heater: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
84
|
-
}
|
|
82
|
+
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
83
|
+
this.debugLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
84
|
+
} else if (device.logging) {
|
|
85
|
+
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
86
|
+
this.debugLog(`Water Heater: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
85
87
|
} else if (this.platform.config.options?.logging) {
|
|
86
88
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
87
|
-
|
|
88
|
-
this.warnLog(`Water Heater: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
89
|
-
}
|
|
89
|
+
this.debugLog(`Water Heater: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
90
90
|
} else {
|
|
91
91
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
92
|
+
this.debugLog(`Water Heater: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
95
|
|
package/src/settings.ts
CHANGED
|
@@ -50,7 +50,7 @@ export interface devicesConfig extends device {
|
|
|
50
50
|
contact?: contact;
|
|
51
51
|
motion?: motion;
|
|
52
52
|
colorbulb?: colorbulb;
|
|
53
|
-
plug?:
|
|
53
|
+
plug?: Record<any, any>;
|
|
54
54
|
ble?: string;
|
|
55
55
|
scanDuration?: number;
|
|
56
56
|
hide_device?: boolean;
|
|
@@ -108,11 +108,11 @@ export interface irDevicesConfig extends irdevice {
|
|
|
108
108
|
logging?: string;
|
|
109
109
|
irfan?: irfan;
|
|
110
110
|
irair?: irair;
|
|
111
|
-
irpur?:
|
|
112
|
-
ircam?:
|
|
113
|
-
irlight?:
|
|
114
|
-
irvc?:
|
|
115
|
-
irwh?:
|
|
111
|
+
irpur?: Record<any, any>;
|
|
112
|
+
ircam?: Record<any, any>;
|
|
113
|
+
irlight?: Record<any, any>;
|
|
114
|
+
irvc?: Record<any, any>;
|
|
115
|
+
irwh?: Record<any, any>;
|
|
116
116
|
irtv?: irtv;
|
|
117
117
|
other?: other;
|
|
118
118
|
hide_device?: boolean;
|