@switchbot/homebridge-switchbot 3.5.0-beta.25 → 3.5.0-beta.27

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 (101) hide show
  1. package/dist/device/blindtilt.d.ts.map +1 -1
  2. package/dist/device/blindtilt.js +17 -14
  3. package/dist/device/blindtilt.js.map +1 -1
  4. package/dist/device/bot.js +13 -13
  5. package/dist/device/bot.js.map +1 -1
  6. package/dist/device/ceilinglight.js +3 -3
  7. package/dist/device/ceilinglight.js.map +1 -1
  8. package/dist/device/colorbulb.js +3 -3
  9. package/dist/device/colorbulb.js.map +1 -1
  10. package/dist/device/contact.js +5 -5
  11. package/dist/device/contact.js.map +1 -1
  12. package/dist/device/curtain.d.ts.map +1 -1
  13. package/dist/device/curtain.js +12 -12
  14. package/dist/device/curtain.js.map +1 -1
  15. package/dist/device/hub.d.ts.map +1 -1
  16. package/dist/device/hub.js +6 -6
  17. package/dist/device/hub.js.map +1 -1
  18. package/dist/device/humidifier.js +4 -4
  19. package/dist/device/humidifier.js.map +1 -1
  20. package/dist/device/iosensor.js +5 -5
  21. package/dist/device/iosensor.js.map +1 -1
  22. package/dist/device/lightstrip.js +3 -3
  23. package/dist/device/lightstrip.js.map +1 -1
  24. package/dist/device/lock.js +6 -6
  25. package/dist/device/lock.js.map +1 -1
  26. package/dist/device/meter.js +5 -5
  27. package/dist/device/meter.js.map +1 -1
  28. package/dist/device/meterplus.js +5 -5
  29. package/dist/device/meterplus.js.map +1 -1
  30. package/dist/device/motion.js +5 -6
  31. package/dist/device/motion.js.map +1 -1
  32. package/dist/device/plug.js +3 -3
  33. package/dist/device/plug.js.map +1 -1
  34. package/dist/device/robotvacuumcleaner.js +4 -4
  35. package/dist/device/robotvacuumcleaner.js.map +1 -1
  36. package/dist/device/waterdetector.d.ts.map +1 -1
  37. package/dist/device/waterdetector.js +9 -16
  38. package/dist/device/waterdetector.js.map +1 -1
  39. package/dist/irdevice/airconditioner.d.ts +4 -14
  40. package/dist/irdevice/airconditioner.d.ts.map +1 -1
  41. package/dist/irdevice/airconditioner.js +226 -234
  42. package/dist/irdevice/airconditioner.js.map +1 -1
  43. package/dist/irdevice/airpurifier.d.ts +3 -6
  44. package/dist/irdevice/airpurifier.d.ts.map +1 -1
  45. package/dist/irdevice/airpurifier.js +65 -56
  46. package/dist/irdevice/airpurifier.js.map +1 -1
  47. package/dist/irdevice/camera.d.ts +2 -3
  48. package/dist/irdevice/camera.d.ts.map +1 -1
  49. package/dist/irdevice/camera.js +24 -27
  50. package/dist/irdevice/camera.js.map +1 -1
  51. package/dist/irdevice/fan.d.ts +2 -7
  52. package/dist/irdevice/fan.d.ts.map +1 -1
  53. package/dist/irdevice/fan.js +57 -61
  54. package/dist/irdevice/fan.js.map +1 -1
  55. package/dist/irdevice/irdevice.js +1 -1
  56. package/dist/irdevice/irdevice.js.map +1 -1
  57. package/dist/irdevice/light.d.ts +1 -1
  58. package/dist/irdevice/light.d.ts.map +1 -1
  59. package/dist/irdevice/light.js +13 -15
  60. package/dist/irdevice/light.js.map +1 -1
  61. package/dist/irdevice/other.js +51 -50
  62. package/dist/irdevice/other.js.map +1 -1
  63. package/dist/irdevice/tv.js +2 -2
  64. package/dist/irdevice/tv.js.map +1 -1
  65. package/dist/irdevice/vacuumcleaner.js +1 -1
  66. package/dist/irdevice/vacuumcleaner.js.map +1 -1
  67. package/dist/irdevice/waterheater.js +1 -1
  68. package/dist/irdevice/waterheater.js.map +1 -1
  69. package/dist/platform.d.ts.map +1 -1
  70. package/dist/platform.js +22 -2
  71. package/dist/platform.js.map +1 -1
  72. package/package.json +2 -2
  73. package/src/custom.d.ts +1 -0
  74. package/src/device/blindtilt.ts +20 -18
  75. package/src/device/bot.ts +14 -14
  76. package/src/device/ceilinglight.ts +4 -4
  77. package/src/device/colorbulb.ts +4 -4
  78. package/src/device/contact.ts +6 -6
  79. package/src/device/curtain.ts +14 -13
  80. package/src/device/hub.ts +7 -6
  81. package/src/device/humidifier.ts +5 -5
  82. package/src/device/iosensor.ts +6 -6
  83. package/src/device/lightstrip.ts +4 -4
  84. package/src/device/lock.ts +7 -7
  85. package/src/device/meter.ts +6 -6
  86. package/src/device/meterplus.ts +6 -6
  87. package/src/device/motion.ts +6 -6
  88. package/src/device/plug.ts +4 -4
  89. package/src/device/robotvacuumcleaner.ts +5 -5
  90. package/src/device/waterdetector.ts +9 -17
  91. package/src/irdevice/airconditioner.ts +239 -238
  92. package/src/irdevice/airpurifier.ts +75 -56
  93. package/src/irdevice/camera.ts +27 -27
  94. package/src/irdevice/fan.ts +63 -63
  95. package/src/irdevice/irdevice.ts +1 -1
  96. package/src/irdevice/light.ts +17 -15
  97. package/src/irdevice/other.ts +51 -51
  98. package/src/irdevice/tv.ts +2 -2
  99. package/src/irdevice/vacuumcleaner.ts +1 -1
  100. package/src/irdevice/waterheater.ts +1 -1
  101. package/src/platform.ts +21 -5
@@ -38,23 +38,23 @@ export class RobotVacuumCleaner extends deviceBase {
38
38
  this.doRobotVacuumCleanerUpdate = new Subject();
39
39
  this.robotVacuumCleanerUpdateInProgress = false;
40
40
 
41
- // Retrieve initial values and updateHomekit
42
- this.refreshStatus();
43
-
44
41
  // Initialize Lightbulb property
45
42
  this.LightBulb = {
46
- Service: this.accessory.addService(this.hap.Service.Lightbulb),
43
+ Service: accessory.getService(this.hap.Service.Lightbulb)!,
47
44
  On: accessory.context.On || false,
48
45
  Brightness: accessory.context.Brightness || 0,
49
46
  };
50
47
 
51
48
  // Initialize Battery property
52
49
  this.Battery = {
53
- Service: this.accessory.addService(this.hap.Service.Battery),
50
+ Service: accessory.getService(this.hap.Service.Battery)!,
54
51
  BatteryLevel: accessory.context.BatteryLevel || 100,
55
52
  StatusLowBattery: accessory.context.StatusLowBattery || this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL,
56
53
  };
57
54
 
55
+ // Retrieve initial values and updateHomekit
56
+ this.refreshStatus();
57
+
58
58
  // get the Lightbulb service if it exists, otherwise create a new Lightbulb service
59
59
  // you can create multiple services for each accessory
60
60
  const LightBulbService = `${accessory.displayName} ${device.deviceType}`;
@@ -46,33 +46,25 @@ export class WaterDetector extends deviceBase {
46
46
  this.doWaterDetectorUpdate = new Subject();
47
47
  this.WaterDetectorUpdateInProgress = false;
48
48
 
49
- // Retrieve initial values and updateHomekit
50
- this.refreshStatus();
51
-
52
49
  // Initialize Battery property
53
50
  this.Battery = {
54
- Service: this.accessory.getService(this.hap.Service.Battery) || this.accessory.addService(this.hap.Service.Battery),
55
- BatteryLevel: this.accessory.context.BatteryLevel || 100,
56
- StatusLowBattery: this.accessory.context.StatusLowBattery || this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL,
57
- ChargingState: this.accessory.context.ChargingState || this.hap.Characteristic.ChargingState.NOT_CHARGEABLE,
51
+ Service: accessory.getService(this.hap.Service.Battery)!,
52
+ BatteryLevel: accessory.context.BatteryLevel || 100,
53
+ StatusLowBattery: accessory.context.StatusLowBattery || this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL,
54
+ ChargingState: accessory.context.ChargingState || this.hap.Characteristic.ChargingState.NOT_CHARGEABLE,
58
55
  };
59
56
 
60
57
  // Initialize Leak Sensor property
61
58
  if (!this.device.waterdetector?.hide_leak) {
62
59
  this.LeakSensor = {
63
- Service: this.accessory.getService(this.hap.Service.LeakSensor) || this.accessory.addService(this.hap.Service.LeakSensor),
64
- StatusActive: this.accessory.context.StatusActive || false,
65
- LeakDetected: this.accessory.context.LeakDetected || this.hap.Characteristic.LeakDetected.LEAK_NOT_DETECTED,
60
+ Service: accessory.getService(this.hap.Service.LeakSensor)!,
61
+ StatusActive: accessory.context.StatusActive || false,
62
+ LeakDetected: accessory.context.LeakDetected || this.hap.Characteristic.LeakDetected.LEAK_NOT_DETECTED,
66
63
  };
67
64
  }
68
65
 
69
- // set accessory information
70
- accessory
71
- .getService(this.hap.Service.AccessoryInformation)!
72
- .setCharacteristic(this.hap.Characteristic.Manufacturer, 'SwitchBot')
73
- .setCharacteristic(this.hap.Characteristic.Model, 'WoWaterDetector')
74
- .setCharacteristic(this.hap.Characteristic.SerialNumber, device.deviceId)
75
- .setCharacteristic(this.hap.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision);
66
+ // Retrieve initial values and updateHomekit
67
+ this.refreshStatus();
76
68
 
77
69
  // Leak Sensor Service
78
70
  if (device.waterdetector?.hide_leak) {