@switchbot/homebridge-switchbot 1.11.1 → 1.12.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 (83) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/config.schema.json +18 -3
  3. package/dist/device/bot.d.ts +8 -0
  4. package/dist/device/bot.d.ts.map +1 -1
  5. package/dist/device/bot.js +40 -21
  6. package/dist/device/bot.js.map +1 -1
  7. package/dist/device/colorbulb.d.ts.map +1 -1
  8. package/dist/device/colorbulb.js +8 -26
  9. package/dist/device/colorbulb.js.map +1 -1
  10. package/dist/device/contact.d.ts.map +1 -1
  11. package/dist/device/contact.js +4 -10
  12. package/dist/device/contact.js.map +1 -1
  13. package/dist/device/curtain.d.ts.map +1 -1
  14. package/dist/device/curtain.js +13 -28
  15. package/dist/device/curtain.js.map +1 -1
  16. package/dist/device/humidifier.d.ts.map +1 -1
  17. package/dist/device/humidifier.js +9 -30
  18. package/dist/device/humidifier.js.map +1 -1
  19. package/dist/device/lock.d.ts.map +1 -1
  20. package/dist/device/lock.js +4 -10
  21. package/dist/device/lock.js.map +1 -1
  22. package/dist/device/meter.d.ts.map +1 -1
  23. package/dist/device/meter.js +4 -10
  24. package/dist/device/meter.js.map +1 -1
  25. package/dist/device/motion.d.ts.map +1 -1
  26. package/dist/device/motion.js +4 -10
  27. package/dist/device/motion.js.map +1 -1
  28. package/dist/device/plug.d.ts.map +1 -1
  29. package/dist/device/plug.js +4 -10
  30. package/dist/device/plug.js.map +1 -1
  31. package/dist/irdevice/airconditioner.d.ts.map +1 -1
  32. package/dist/irdevice/airconditioner.js +3 -6
  33. package/dist/irdevice/airconditioner.js.map +1 -1
  34. package/dist/irdevice/airpurifier.d.ts.map +1 -1
  35. package/dist/irdevice/airpurifier.js +3 -6
  36. package/dist/irdevice/airpurifier.js.map +1 -1
  37. package/dist/irdevice/camera.d.ts.map +1 -1
  38. package/dist/irdevice/camera.js +3 -6
  39. package/dist/irdevice/camera.js.map +1 -1
  40. package/dist/irdevice/fan.d.ts.map +1 -1
  41. package/dist/irdevice/fan.js +3 -6
  42. package/dist/irdevice/fan.js.map +1 -1
  43. package/dist/irdevice/light.d.ts.map +1 -1
  44. package/dist/irdevice/light.js +3 -6
  45. package/dist/irdevice/light.js.map +1 -1
  46. package/dist/irdevice/other.d.ts.map +1 -1
  47. package/dist/irdevice/other.js +4 -7
  48. package/dist/irdevice/other.js.map +1 -1
  49. package/dist/irdevice/tv.d.ts.map +1 -1
  50. package/dist/irdevice/tv.js +3 -6
  51. package/dist/irdevice/tv.js.map +1 -1
  52. package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
  53. package/dist/irdevice/vacuumcleaner.js +3 -6
  54. package/dist/irdevice/vacuumcleaner.js.map +1 -1
  55. package/dist/irdevice/waterheater.d.ts.map +1 -1
  56. package/dist/irdevice/waterheater.js +3 -6
  57. package/dist/irdevice/waterheater.js.map +1 -1
  58. package/dist/platform.js +6 -6
  59. package/dist/platform.js.map +1 -1
  60. package/dist/settings.d.ts +1 -0
  61. package/dist/settings.d.ts.map +1 -1
  62. package/dist/settings.js.map +1 -1
  63. package/package.json +76 -76
  64. package/src/device/bot.ts +40 -20
  65. package/src/device/colorbulb.ts +8 -36
  66. package/src/device/contact.ts +4 -12
  67. package/src/device/curtain.ts +13 -28
  68. package/src/device/humidifier.ts +9 -30
  69. package/src/device/lock.ts +4 -10
  70. package/src/device/meter.ts +4 -10
  71. package/src/device/motion.ts +4 -12
  72. package/src/device/plug.ts +4 -10
  73. package/src/irdevice/airconditioner.ts +3 -6
  74. package/src/irdevice/airpurifier.ts +3 -6
  75. package/src/irdevice/camera.ts +3 -6
  76. package/src/irdevice/fan.ts +3 -6
  77. package/src/irdevice/light.ts +3 -6
  78. package/src/irdevice/other.ts +4 -7
  79. package/src/irdevice/tv.ts +3 -8
  80. package/src/irdevice/vacuumcleaner.ts +3 -6
  81. package/src/irdevice/waterheater.ts +3 -6
  82. package/src/platform.ts +6 -6
  83. package/src/settings.ts +1 -0
package/src/platform.ts CHANGED
@@ -61,7 +61,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
61
61
  this.debugLog('Config OK');
62
62
  } catch (e: any) {
63
63
  this.errorLog(JSON.stringify(e.message));
64
- if (this.platformLogging === 'debugMode') {
64
+ if (this.platformLogging?.includes('debug')) {
65
65
  this.errorLog(JSON.stringify(e));
66
66
  }
67
67
  return;
@@ -85,7 +85,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
85
85
  this.discoverDevices();
86
86
  } catch (e: any) {
87
87
  this.errorLog('Failed to Discover Devices.', JSON.stringify(e.message));
88
- if (this.platformLogging === 'debugMode') {
88
+ if (this.platformLogging?.includes('debug')) {
89
89
  this.errorLog(JSON.stringify(e));
90
90
  }
91
91
  }
@@ -117,7 +117,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
117
117
  * It should be used to setup event handlers for characteristics and update respective values.
118
118
  */
119
119
  configureAccessory(accessory: PlatformAccessory) {
120
- this.infoLog(`Loading accessory from cache: ${accessory.displayName}`);
120
+ this.debugLog(`Loading accessory from cache: ${accessory.displayName}`);
121
121
 
122
122
  // add the restored accessory to the accessories cache so we can track if it has already been registered
123
123
  this.accessories.push(accessory);
@@ -140,7 +140,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
140
140
  platformConfig['pushRate'] = this.config.options.pushRate;
141
141
  }
142
142
  if (Object.entries(platformConfig).length !== 0) {
143
- this.warnLog(`Platform Config: ${JSON.stringify(platformConfig)}`);
143
+ this.infoLog(`Platform Config: ${JSON.stringify(platformConfig)}`);
144
144
  }
145
145
 
146
146
  if (this.config.options) {
@@ -1546,13 +1546,13 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1546
1546
  }
1547
1547
 
1548
1548
  public deviceListInfo(devices: deviceResponses) {
1549
- if (this.platformLogging === 'debug') {
1549
+ if (this.platformLogging?.includes('debug')) {
1550
1550
  this.warnLog(`deviceListInfoStatus: ${JSON.stringify(devices)}`);
1551
1551
  }
1552
1552
  }
1553
1553
 
1554
1554
  public async deviceInfo(device: (irdevice & devicesConfig) | (device & devicesConfig)) {
1555
- if (this.platformLogging === 'debug') {
1555
+ if (this.platformLogging?.includes('debug')) {
1556
1556
  this.warnLog(JSON.stringify(device));
1557
1557
  this.deviceStatus = (await this.axios.get(`${DeviceURL}/${device.deviceId}/status`)).data;
1558
1558
  if (this.deviceStatus.message === 'success') {
package/src/settings.ts CHANGED
@@ -68,6 +68,7 @@ export type bot = {
68
68
  deviceType?: string;
69
69
  doublePress?: number;
70
70
  allowPush?: boolean;
71
+ maxRetry?: number;
71
72
  };
72
73
 
73
74
  export type humidifier = {