@switchbot/homebridge-switchbot 1.5.1-beta.1 → 1.5.1-beta.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.
Files changed (69) hide show
  1. package/dist/devices/bots.d.ts.map +1 -1
  2. package/dist/devices/bots.js +21 -15
  3. package/dist/devices/bots.js.map +1 -1
  4. package/dist/devices/colorbulb.d.ts.map +1 -1
  5. package/dist/devices/colorbulb.js +17 -11
  6. package/dist/devices/colorbulb.js.map +1 -1
  7. package/dist/devices/contact.d.ts.map +1 -1
  8. package/dist/devices/contact.js +17 -11
  9. package/dist/devices/contact.js.map +1 -1
  10. package/dist/devices/curtains.d.ts.map +1 -1
  11. package/dist/devices/curtains.js +17 -11
  12. package/dist/devices/curtains.js.map +1 -1
  13. package/dist/devices/humidifiers.d.ts.map +1 -1
  14. package/dist/devices/humidifiers.js +17 -11
  15. package/dist/devices/humidifiers.js.map +1 -1
  16. package/dist/devices/meters.d.ts.map +1 -1
  17. package/dist/devices/meters.js +17 -11
  18. package/dist/devices/meters.js.map +1 -1
  19. package/dist/devices/motion.d.ts.map +1 -1
  20. package/dist/devices/motion.js +17 -11
  21. package/dist/devices/motion.js.map +1 -1
  22. package/dist/devices/plugs.d.ts.map +1 -1
  23. package/dist/devices/plugs.js +17 -11
  24. package/dist/devices/plugs.js.map +1 -1
  25. package/dist/irdevices/airconditioners.d.ts.map +1 -1
  26. package/dist/irdevices/airconditioners.js +16 -1
  27. package/dist/irdevices/airconditioners.js.map +1 -1
  28. package/dist/irdevices/airpurifiers.d.ts.map +1 -1
  29. package/dist/irdevices/airpurifiers.js +16 -1
  30. package/dist/irdevices/airpurifiers.js.map +1 -1
  31. package/dist/irdevices/cameras.d.ts.map +1 -1
  32. package/dist/irdevices/cameras.js +16 -1
  33. package/dist/irdevices/cameras.js.map +1 -1
  34. package/dist/irdevices/fans.d.ts.map +1 -1
  35. package/dist/irdevices/fans.js +16 -1
  36. package/dist/irdevices/fans.js.map +1 -1
  37. package/dist/irdevices/lights.d.ts.map +1 -1
  38. package/dist/irdevices/lights.js +16 -1
  39. package/dist/irdevices/lights.js.map +1 -1
  40. package/dist/irdevices/others.d.ts.map +1 -1
  41. package/dist/irdevices/others.js +16 -1
  42. package/dist/irdevices/others.js.map +1 -1
  43. package/dist/irdevices/tvs.d.ts.map +1 -1
  44. package/dist/irdevices/tvs.js +16 -1
  45. package/dist/irdevices/tvs.js.map +1 -1
  46. package/dist/irdevices/vacuumcleaners.d.ts.map +1 -1
  47. package/dist/irdevices/vacuumcleaners.js +16 -1
  48. package/dist/irdevices/vacuumcleaners.js.map +1 -1
  49. package/dist/irdevices/waterheaters.d.ts.map +1 -1
  50. package/dist/irdevices/waterheaters.js +16 -1
  51. package/dist/irdevices/waterheaters.js.map +1 -1
  52. package/package.json +6 -6
  53. package/src/devices/bots.ts +20 -15
  54. package/src/devices/colorbulb.ts +16 -11
  55. package/src/devices/contact.ts +16 -11
  56. package/src/devices/curtains.ts +17 -12
  57. package/src/devices/humidifiers.ts +16 -11
  58. package/src/devices/meters.ts +16 -11
  59. package/src/devices/motion.ts +16 -11
  60. package/src/devices/plugs.ts +16 -11
  61. package/src/irdevices/airconditioners.ts +15 -1
  62. package/src/irdevices/airpurifiers.ts +15 -1
  63. package/src/irdevices/cameras.ts +15 -1
  64. package/src/irdevices/fans.ts +15 -1
  65. package/src/irdevices/lights.ts +15 -1
  66. package/src/irdevices/others.ts +16 -2
  67. package/src/irdevices/tvs.ts +15 -1
  68. package/src/irdevices/vacuumcleaners.ts +15 -1
  69. package/src/irdevices/waterheaters.ts +15 -1
@@ -193,32 +193,37 @@ export class Humidifier {
193
193
  refreshRate() {
194
194
  if (this.device.refreshRate) {
195
195
  this.deviceRefreshRate = this.accessory.context.refreshRate = this.device.refreshRate;
196
- if (this.platform.debugMode) {
197
- this.warnLog(`Using Device Config refreshRate: ${this.deviceRefreshRate}`);
196
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
197
+ this.warnLog(`Humidifier: ${this.accessory.displayName} Using Device Config refreshRate: ${this.deviceRefreshRate}`);
198
198
  }
199
199
  } else if (this.platform.config.options!.refreshRate) {
200
200
  this.deviceRefreshRate = this.accessory.context.refreshRate = this.platform.config.options!.refreshRate;
201
- if (this.platform.debugMode) {
202
- this.warnLog(`Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
201
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
202
+ this.warnLog(`Humidifier: ${this.accessory.displayName} Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
203
203
  }
204
204
  }
205
205
  }
206
206
 
207
207
  logs() {
208
- if (this.device.logging) {
208
+ if (this.platform.debugMode) {
209
+ this.deviceLogging = this.accessory.context.logging = 'debug';
210
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
211
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
212
+ }
213
+ } else if (this.device.logging) {
209
214
  this.deviceLogging = this.accessory.context.logging = this.device.logging;
210
- if (this.platform.debugMode) {
211
- this.warnLog(`Using Device Config Logging: ${this.deviceLogging}`);
215
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
216
+ this.warnLog(`Humidifier: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
212
217
  }
213
218
  } else if (this.platform.config.options?.logging) {
214
219
  this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
215
- if (this.platform.debugMode) {
216
- this.warnLog(`Using Platform Config Logging: ${this.deviceLogging}`);
220
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
221
+ this.warnLog(`Humidifier: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
217
222
  }
218
223
  } else {
219
224
  this.deviceLogging = this.accessory.context.logging = 'standard';
220
- if (this.platform.debugMode) {
221
- this.warnLog('Using Device Standard Logging');
225
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
226
+ this.warnLog(`Humidifier: ${this.accessory.displayName} Using Device Standard Logging`);
222
227
  }
223
228
  }
224
229
  }
@@ -183,32 +183,37 @@ export class Meter {
183
183
  refreshRate() {
184
184
  if (this.device.refreshRate) {
185
185
  this.deviceRefreshRate = this.accessory.context.refreshRate = this.device.refreshRate;
186
- if (this.platform.debugMode) {
187
- this.warnLog(`Using Device Config refreshRate: ${this.deviceRefreshRate}`);
186
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
187
+ this.warnLog(`Meter: ${this.accessory.displayName} Using Device Config refreshRate: ${this.deviceRefreshRate}`);
188
188
  }
189
189
  } else if (this.platform.config.options!.refreshRate) {
190
190
  this.deviceRefreshRate = this.accessory.context.refreshRate = this.platform.config.options!.refreshRate;
191
- if (this.platform.debugMode) {
192
- this.warnLog(`Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
191
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
192
+ this.warnLog(`Meter: ${this.accessory.displayName} Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
193
193
  }
194
194
  }
195
195
  }
196
196
 
197
197
  logs() {
198
- if (this.device.logging) {
198
+ if (this.platform.debugMode) {
199
+ this.deviceLogging = this.accessory.context.logging = 'debug';
200
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
201
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
202
+ }
203
+ } else if (this.device.logging) {
199
204
  this.deviceLogging = this.accessory.context.logging = this.device.logging;
200
- if (this.platform.debugMode) {
201
- this.warnLog(`Using Device Config Logging: ${this.deviceLogging}`);
205
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
206
+ this.warnLog(`Meter: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
202
207
  }
203
208
  } else if (this.platform.config.options?.logging) {
204
209
  this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
205
- if (this.platform.debugMode) {
206
- this.warnLog(`Using Platform Config Logging: ${this.deviceLogging}`);
210
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
211
+ this.warnLog(`Meter: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
207
212
  }
208
213
  } else {
209
214
  this.deviceLogging = this.accessory.context.logging = 'standard';
210
- if (this.platform.debugMode) {
211
- this.warnLog('Using Device Standard Logging');
215
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
216
+ this.warnLog(`Meter: ${this.accessory.displayName} Using Device Standard Logging`);
212
217
  }
213
218
  }
214
219
  }
@@ -114,32 +114,37 @@ export class Motion {
114
114
  refreshRate() {
115
115
  if (this.device.refreshRate) {
116
116
  this.deviceRefreshRate = this.accessory.context.refreshRate = this.device.refreshRate;
117
- if (this.platform.debugMode) {
118
- this.warnLog(`Using Device Config refreshRate: ${this.deviceRefreshRate}`);
117
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
118
+ this.warnLog(`Motion Sensor: ${this.accessory.displayName} Using Device Config refreshRate: ${this.deviceRefreshRate}`);
119
119
  }
120
120
  } else if (this.platform.config.options!.refreshRate) {
121
121
  this.deviceRefreshRate = this.accessory.context.refreshRate = this.platform.config.options!.refreshRate;
122
- if (this.platform.debugMode) {
123
- this.warnLog(`Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
122
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
123
+ this.warnLog(`Motion Sensor: ${this.accessory.displayName} Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
124
124
  }
125
125
  }
126
126
  }
127
127
 
128
128
  logs() {
129
- if (this.device.logging) {
129
+ if (this.platform.debugMode) {
130
+ this.deviceLogging = this.accessory.context.logging = 'debug';
131
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
132
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
133
+ }
134
+ } else if (this.device.logging) {
130
135
  this.deviceLogging = this.accessory.context.logging = this.device.logging;
131
- if (this.platform.debugMode) {
132
- this.warnLog(`Using Device Config Logging: ${this.deviceLogging}`);
136
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
137
+ this.warnLog(`Motion Sensor: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
133
138
  }
134
139
  } else if (this.platform.config.options?.logging) {
135
140
  this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
136
- if (this.platform.debugMode) {
137
- this.warnLog(`Using Platform Config Logging: ${this.deviceLogging}`);
141
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
142
+ this.warnLog(`Motion Sensor: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
138
143
  }
139
144
  } else {
140
145
  this.deviceLogging = this.accessory.context.logging = 'standard';
141
- if (this.platform.debugMode) {
142
- this.warnLog('Using Device Standard Logging');
146
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
147
+ this.warnLog(`Motion Sensor: ${this.accessory.displayName} Using Device Standard Logging`);
143
148
  }
144
149
  }
145
150
  }
@@ -117,32 +117,37 @@ export class Plug {
117
117
  refreshRate() {
118
118
  if (this.device.refreshRate) {
119
119
  this.deviceRefreshRate = this.accessory.context.refreshRate = this.device.refreshRate;
120
- if (this.platform.debugMode) {
121
- this.warnLog(`Using Device Config refreshRate: ${this.deviceRefreshRate}`);
120
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
121
+ this.warnLog(`Plug: ${this.accessory.displayName} Using Device Config refreshRate: ${this.deviceRefreshRate}`);
122
122
  }
123
123
  } else if (this.platform.config.options!.refreshRate) {
124
124
  this.deviceRefreshRate = this.accessory.context.refreshRate = this.platform.config.options!.refreshRate;
125
- if (this.platform.debugMode) {
126
- this.warnLog(`Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
125
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
126
+ this.warnLog(`Plug: ${this.accessory.displayName} Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
127
127
  }
128
128
  }
129
129
  }
130
130
 
131
131
  logs() {
132
- if (this.device.logging) {
132
+ if (this.platform.debugMode) {
133
+ this.deviceLogging = this.accessory.context.logging = 'debug';
134
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
135
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
136
+ }
137
+ } else if (this.device.logging) {
133
138
  this.deviceLogging = this.accessory.context.logging = this.device.logging;
134
- if (this.platform.debugMode) {
135
- this.warnLog(`Using Device Config Logging: ${this.deviceLogging}`);
139
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
140
+ this.warnLog(`Plug: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
136
141
  }
137
142
  } else if (this.platform.config.options?.logging) {
138
143
  this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
139
- if (this.platform.debugMode) {
140
- this.warnLog(`Using Platform Config Logging: ${this.deviceLogging}`);
144
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
145
+ this.warnLog(`Plug: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
141
146
  }
142
147
  } else {
143
148
  this.deviceLogging = this.accessory.context.logging = 'standard';
144
- if (this.platform.debugMode) {
145
- this.warnLog('Using Device Standard Logging');
149
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
150
+ this.warnLog(`Plug: ${this.accessory.displayName} Using Device Standard Logging`);
146
151
  }
147
152
  }
148
153
  }
@@ -167,12 +167,26 @@ export class AirConditioner {
167
167
  }
168
168
 
169
169
  logs() {
170
- if (this.device.logging) {
170
+ if (this.platform.debugMode) {
171
+ this.deviceLogging = this.accessory.context.logging = 'debug';
172
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
173
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
174
+ }
175
+ } else if (this.device.logging) {
171
176
  this.deviceLogging = this.accessory.context.logging = this.device.logging;
177
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
178
+ this.warnLog(`Air Conditioner: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
179
+ }
172
180
  } else if (this.platform.config.options?.logging) {
173
181
  this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
182
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
183
+ this.warnLog(`Air Conditioner: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
184
+ }
174
185
  } else {
175
186
  this.deviceLogging = this.accessory.context.logging = 'standard';
187
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
188
+ this.warnLog(`Air Conditioner: ${this.accessory.displayName} Using Device Standard Logging`);
189
+ }
176
190
  }
177
191
  }
178
192
 
@@ -88,12 +88,26 @@ export class AirPurifier {
88
88
  }
89
89
 
90
90
  logs() {
91
- if (this.device.logging) {
91
+ if (this.platform.debugMode) {
92
+ this.deviceLogging = this.accessory.context.logging = 'debug';
93
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
94
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
95
+ }
96
+ } else if (this.device.logging) {
92
97
  this.deviceLogging = this.accessory.context.logging = this.device.logging;
98
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
99
+ this.warnLog(`Air Purifier: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
100
+ }
93
101
  } else if (this.platform.config.options?.logging) {
94
102
  this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
103
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
104
+ this.warnLog(`Air Purifier: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
105
+ }
95
106
  } else {
96
107
  this.deviceLogging = this.accessory.context.logging = 'standard';
108
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
109
+ this.warnLog(`Air Purifier: ${this.accessory.displayName} Using Device Standard Logging`);
110
+ }
97
111
  }
98
112
  }
99
113
 
@@ -58,12 +58,26 @@ export class Camera {
58
58
  }
59
59
 
60
60
  logs() {
61
- if (this.device.logging) {
61
+ if (this.platform.debugMode) {
62
+ this.deviceLogging = this.accessory.context.logging = 'debug';
63
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
64
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
65
+ }
66
+ } else if (this.device.logging) {
62
67
  this.deviceLogging = this.accessory.context.logging = this.device.logging;
68
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
69
+ this.warnLog(`Camera: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
70
+ }
63
71
  } else if (this.platform.config.options?.logging) {
64
72
  this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
73
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
74
+ this.warnLog(`Camera: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
75
+ }
65
76
  } else {
66
77
  this.deviceLogging = this.accessory.context.logging = 'standard';
78
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
79
+ this.warnLog(`Camera: ${this.accessory.displayName} Using Device Standard Logging`);
80
+ }
67
81
  }
68
82
  }
69
83
 
@@ -117,12 +117,26 @@ export class Fan {
117
117
  }
118
118
 
119
119
  logs() {
120
- if (this.device.logging) {
120
+ if (this.platform.debugMode) {
121
+ this.deviceLogging = this.accessory.context.logging = 'debug';
122
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
123
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
124
+ }
125
+ } else if (this.device.logging) {
121
126
  this.deviceLogging = this.accessory.context.logging = this.device.logging;
127
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
128
+ this.warnLog(`Fan: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
129
+ }
122
130
  } else if (this.platform.config.options?.logging) {
123
131
  this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
132
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
133
+ this.warnLog(`Fan: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
134
+ }
124
135
  } else {
125
136
  this.deviceLogging = this.accessory.context.logging = 'standard';
137
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
138
+ this.warnLog(`Fan: ${this.accessory.displayName} Using Device Standard Logging`);
139
+ }
126
140
  }
127
141
  }
128
142
 
@@ -73,12 +73,26 @@ export class Light {
73
73
  }
74
74
 
75
75
  logs() {
76
- if (this.device.logging) {
76
+ if (this.platform.debugMode) {
77
+ this.deviceLogging = this.accessory.context.logging = 'debug';
78
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
79
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
80
+ }
81
+ } else if (this.device.logging) {
77
82
  this.deviceLogging = this.accessory.context.logging = this.device.logging;
83
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
84
+ this.warnLog(`Light: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
85
+ }
78
86
  } else if (this.platform.config.options?.logging) {
79
87
  this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
88
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
89
+ this.warnLog(`Light: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
90
+ }
80
91
  } else {
81
92
  this.deviceLogging = this.accessory.context.logging = 'standard';
93
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
94
+ this.warnLog(`Light: ${this.accessory.displayName} Using Device Standard Logging`);
95
+ }
82
96
  }
83
97
  }
84
98
 
@@ -1,7 +1,7 @@
1
1
  import { AxiosResponse } from 'axios';
2
2
  import { SwitchBotPlatform } from '../platform';
3
3
  import { irDevicesConfig, DeviceURL, irdevice, payload } from '../settings';
4
- import { CharacteristicValue, HAPStatus, PlatformAccessory, Service } from 'homebridge';
4
+ import { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
5
5
 
6
6
  /**
7
7
  * Platform Accessory
@@ -55,12 +55,26 @@ export class Others {
55
55
  }
56
56
 
57
57
  logs() {
58
- if (this.device.logging) {
58
+ if (this.platform.debugMode) {
59
+ this.deviceLogging = this.accessory.context.logging = 'debug';
60
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
61
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
62
+ }
63
+ } else if (this.device.logging) {
59
64
  this.deviceLogging = this.accessory.context.logging = this.device.logging;
65
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
66
+ this.warnLog(`Other: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
67
+ }
60
68
  } else if (this.platform.config.options?.logging) {
61
69
  this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
70
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
71
+ this.warnLog(`Other: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
72
+ }
62
73
  } else {
63
74
  this.deviceLogging = this.accessory.context.logging = 'standard';
75
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
76
+ this.warnLog(`Other: ${this.accessory.displayName} Using Device Standard Logging`);
77
+ }
64
78
  }
65
79
  }
66
80
 
@@ -129,12 +129,26 @@ export class TV {
129
129
  }
130
130
 
131
131
  logs() {
132
- if (this.device.logging) {
132
+ if (this.platform.debugMode) {
133
+ this.deviceLogging = this.accessory.context.logging = 'debug';
134
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
135
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
136
+ }
137
+ } else if (this.device.logging) {
133
138
  this.deviceLogging = this.accessory.context.logging = this.device.logging;
139
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
140
+ this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
141
+ }
134
142
  } else if (this.platform.config.options?.logging) {
135
143
  this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
144
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
145
+ this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
146
+ }
136
147
  } else {
137
148
  this.deviceLogging = this.accessory.context.logging = 'standard';
149
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
150
+ this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Standard Logging`);
151
+ }
138
152
  }
139
153
  }
140
154
 
@@ -58,12 +58,26 @@ export class VacuumCleaner {
58
58
  }
59
59
 
60
60
  logs() {
61
- if (this.device.logging) {
61
+ if (this.platform.debugMode) {
62
+ this.deviceLogging = this.accessory.context.logging = 'debug';
63
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
64
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
65
+ }
66
+ } else if (this.device.logging) {
62
67
  this.deviceLogging = this.accessory.context.logging = this.device.logging;
68
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
69
+ this.warnLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
70
+ }
63
71
  } else if (this.platform.config.options?.logging) {
64
72
  this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
73
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
74
+ this.warnLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
75
+ }
65
76
  } else {
66
77
  this.deviceLogging = this.accessory.context.logging = 'standard';
78
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
79
+ this.warnLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Device Standard Logging`);
80
+ }
67
81
  }
68
82
  }
69
83
 
@@ -67,12 +67,26 @@ export class WaterHeater {
67
67
  }
68
68
 
69
69
  logs() {
70
- if (this.device.logging) {
70
+ if (this.platform.debugMode) {
71
+ this.deviceLogging = this.accessory.context.logging = 'debug';
72
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
73
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
74
+ }
75
+ } else if (this.device.logging) {
71
76
  this.deviceLogging = this.accessory.context.logging = this.device.logging;
77
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
78
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
79
+ }
72
80
  } else if (this.platform.config.options?.logging) {
73
81
  this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
82
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
83
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
84
+ }
74
85
  } else {
75
86
  this.deviceLogging = this.accessory.context.logging = 'standard';
87
+ if (this.platform.debugMode || (this.deviceLogging === 'debug')) {
88
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Using Device Standard Logging`);
89
+ }
76
90
  }
77
91
  }
78
92