@switchbot/homebridge-switchbot 1.8.1-beta.1 → 1.8.2-beta.0

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 (87) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/devices/bots.d.ts +15 -15
  3. package/dist/devices/bots.d.ts.map +1 -1
  4. package/dist/devices/bots.js +162 -159
  5. package/dist/devices/bots.js.map +1 -1
  6. package/dist/devices/colorbulb.d.ts +5 -5
  7. package/dist/devices/colorbulb.d.ts.map +1 -1
  8. package/dist/devices/colorbulb.js +69 -66
  9. package/dist/devices/colorbulb.js.map +1 -1
  10. package/dist/devices/contact.d.ts +8 -8
  11. package/dist/devices/contact.d.ts.map +1 -1
  12. package/dist/devices/contact.js +81 -78
  13. package/dist/devices/contact.js.map +1 -1
  14. package/dist/devices/curtains.d.ts +7 -7
  15. package/dist/devices/curtains.d.ts.map +1 -1
  16. package/dist/devices/curtains.js +100 -97
  17. package/dist/devices/curtains.js.map +1 -1
  18. package/dist/devices/humidifiers.d.ts +5 -5
  19. package/dist/devices/humidifiers.d.ts.map +1 -1
  20. package/dist/devices/humidifiers.js +72 -69
  21. package/dist/devices/humidifiers.js.map +1 -1
  22. package/dist/devices/meters.d.ts +4 -4
  23. package/dist/devices/meters.d.ts.map +1 -1
  24. package/dist/devices/meters.js +63 -60
  25. package/dist/devices/meters.js.map +1 -1
  26. package/dist/devices/motion.d.ts +6 -6
  27. package/dist/devices/motion.d.ts.map +1 -1
  28. package/dist/devices/motion.js +81 -78
  29. package/dist/devices/motion.js.map +1 -1
  30. package/dist/devices/plugs.d.ts +4 -4
  31. package/dist/devices/plugs.d.ts.map +1 -1
  32. package/dist/devices/plugs.js +63 -60
  33. package/dist/devices/plugs.js.map +1 -1
  34. package/dist/irdevices/airconditioners.d.ts +2 -2
  35. package/dist/irdevices/airconditioners.d.ts.map +1 -1
  36. package/dist/irdevices/airconditioners.js +30 -27
  37. package/dist/irdevices/airconditioners.js.map +1 -1
  38. package/dist/irdevices/airpurifiers.d.ts +2 -2
  39. package/dist/irdevices/airpurifiers.d.ts.map +1 -1
  40. package/dist/irdevices/airpurifiers.js +30 -27
  41. package/dist/irdevices/airpurifiers.js.map +1 -1
  42. package/dist/irdevices/cameras.d.ts +2 -2
  43. package/dist/irdevices/cameras.d.ts.map +1 -1
  44. package/dist/irdevices/cameras.js +30 -27
  45. package/dist/irdevices/cameras.js.map +1 -1
  46. package/dist/irdevices/fans.d.ts +2 -2
  47. package/dist/irdevices/fans.d.ts.map +1 -1
  48. package/dist/irdevices/fans.js +30 -27
  49. package/dist/irdevices/fans.js.map +1 -1
  50. package/dist/irdevices/lights.d.ts +2 -2
  51. package/dist/irdevices/lights.d.ts.map +1 -1
  52. package/dist/irdevices/lights.js +30 -27
  53. package/dist/irdevices/lights.js.map +1 -1
  54. package/dist/irdevices/others.d.ts +3 -3
  55. package/dist/irdevices/others.d.ts.map +1 -1
  56. package/dist/irdevices/others.js +41 -38
  57. package/dist/irdevices/others.js.map +1 -1
  58. package/dist/irdevices/tvs.d.ts +2 -2
  59. package/dist/irdevices/tvs.d.ts.map +1 -1
  60. package/dist/irdevices/tvs.js +30 -27
  61. package/dist/irdevices/tvs.js.map +1 -1
  62. package/dist/irdevices/vacuumcleaners.d.ts +2 -2
  63. package/dist/irdevices/vacuumcleaners.d.ts.map +1 -1
  64. package/dist/irdevices/vacuumcleaners.js +30 -27
  65. package/dist/irdevices/vacuumcleaners.js.map +1 -1
  66. package/dist/irdevices/waterheaters.d.ts +2 -2
  67. package/dist/irdevices/waterheaters.d.ts.map +1 -1
  68. package/dist/irdevices/waterheaters.js +30 -27
  69. package/dist/irdevices/waterheaters.js.map +1 -1
  70. package/package.json +1 -1
  71. package/src/devices/bots.ts +169 -166
  72. package/src/devices/colorbulb.ts +68 -65
  73. package/src/devices/contact.ts +82 -79
  74. package/src/devices/curtains.ts +98 -95
  75. package/src/devices/humidifiers.ts +71 -68
  76. package/src/devices/meters.ts +62 -59
  77. package/src/devices/motion.ts +80 -77
  78. package/src/devices/plugs.ts +62 -59
  79. package/src/irdevices/airconditioners.ts +29 -26
  80. package/src/irdevices/airpurifiers.ts +29 -26
  81. package/src/irdevices/cameras.ts +29 -26
  82. package/src/irdevices/fans.ts +29 -26
  83. package/src/irdevices/lights.ts +29 -26
  84. package/src/irdevices/others.ts +40 -37
  85. package/src/irdevices/tvs.ts +29 -26
  86. package/src/irdevices/vacuumcleaners.ts +29 -26
  87. package/src/irdevices/waterheaters.ts +29 -26
@@ -58,32 +58,6 @@ export class VacuumCleaner {
58
58
  this.service.getCharacteristic(this.platform.Characteristic.On).onSet(this.OnSet.bind(this));
59
59
  }
60
60
 
61
- config(device: irdevice & irDevicesConfig) {
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)}`);
68
- }
69
- }
70
-
71
- logs(device: irdevice & irDevicesConfig) {
72
- if (this.platform.debugMode) {
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}`);
78
- } else if (this.platform.config.options?.logging) {
79
- this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
80
- this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
81
- } else {
82
- this.deviceLogging = this.accessory.context.logging = 'standard';
83
- this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
84
- }
85
- }
86
-
87
61
  private OnSet(value: CharacteristicValue) {
88
62
  this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} On: ${value}`);
89
63
  this.On = value;
@@ -195,6 +169,35 @@ export class VacuumCleaner {
195
169
  //throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
196
170
  }
197
171
 
172
+ config(device: irdevice & irDevicesConfig) {
173
+ let config = {};
174
+ if (device.irvc) {
175
+ config = device.irvc;
176
+ }
177
+ if (device.logging !== undefined) {
178
+ config['logging'] = device.logging;
179
+ }
180
+ if (Object.entries(config).length === 0) {
181
+ this.warnLog(`Vacuum Cleaner: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
182
+ }
183
+ }
184
+
185
+ logs(device: irdevice & irDevicesConfig) {
186
+ if (this.platform.debugMode) {
187
+ this.deviceLogging = this.accessory.context.logging = 'debugMode';
188
+ this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
189
+ } else if (device.logging) {
190
+ this.deviceLogging = this.accessory.context.logging = device.logging;
191
+ this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
192
+ } else if (this.platform.config.options?.logging) {
193
+ this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
194
+ this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
195
+ } else {
196
+ this.deviceLogging = this.accessory.context.logging = 'standard';
197
+ this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
198
+ }
199
+ }
200
+
198
201
  /**
199
202
  * Logging for Device
200
203
  */
@@ -67,32 +67,6 @@ export class WaterHeater {
67
67
  this.service.getCharacteristic(this.platform.Characteristic.Active).onSet(this.ActiveSet.bind(this));
68
68
  }
69
69
 
70
- config(device: irdevice & irDevicesConfig) {
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)}`);
77
- }
78
- }
79
-
80
- logs(device: irdevice & irDevicesConfig) {
81
- if (this.platform.debugMode) {
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}`);
87
- } else if (this.platform.config.options?.logging) {
88
- this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
89
- this.debugLog(`Water Heater: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
90
- } else {
91
- this.deviceLogging = this.accessory.context.logging = 'standard';
92
- this.debugLog(`Water Heater: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
93
- }
94
- }
95
-
96
70
  private ActiveSet(value: CharacteristicValue) {
97
71
  this.debugLog(`Water Heater: ${this.accessory.displayName} Active: ${value}`);
98
72
  if (value === this.platform.Characteristic.Active.INACTIVE) {
@@ -209,6 +183,35 @@ export class WaterHeater {
209
183
  //throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
210
184
  }
211
185
 
186
+ config(device: irdevice & irDevicesConfig) {
187
+ let config = {};
188
+ if (device.irwh) {
189
+ config = device.irwh;
190
+ }
191
+ if (device.logging !== undefined) {
192
+ config['logging'] = device.logging;
193
+ }
194
+ if (Object.entries(config).length === 0) {
195
+ this.warnLog(`Water Heater: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
196
+ }
197
+ }
198
+
199
+ logs(device: irdevice & irDevicesConfig) {
200
+ if (this.platform.debugMode) {
201
+ this.deviceLogging = this.accessory.context.logging = 'debugMode';
202
+ this.debugLog(`Water Heater: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
203
+ } else if (device.logging) {
204
+ this.deviceLogging = this.accessory.context.logging = device.logging;
205
+ this.debugLog(`Water Heater: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
206
+ } else if (this.platform.config.options?.logging) {
207
+ this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
208
+ this.debugLog(`Water Heater: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
209
+ } else {
210
+ this.deviceLogging = this.accessory.context.logging = 'standard';
211
+ this.debugLog(`Water Heater: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
212
+ }
213
+ }
214
+
212
215
  /**
213
216
  * Logging for Device
214
217
  */