@switchbot/homebridge-switchbot 2.14.1-beta.0 → 3.0.0-beta.1

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 (147) hide show
  1. package/.github/{npm-version-script.js → npm-version-script.cjs} +1 -1
  2. package/.github/workflows/dependabot.yml +10 -11
  3. package/CHANGELOG.md +11 -2
  4. package/LICENSE +1 -1
  5. package/dist/device/blindtilt.d.ts +10 -6
  6. package/dist/device/blindtilt.d.ts.map +1 -1
  7. package/dist/device/blindtilt.js +152 -91
  8. package/dist/device/blindtilt.js.map +1 -1
  9. package/dist/device/bot.d.ts +10 -6
  10. package/dist/device/bot.d.ts.map +1 -1
  11. package/dist/device/bot.js +234 -184
  12. package/dist/device/bot.js.map +1 -1
  13. package/dist/device/ceilinglight.d.ts +10 -6
  14. package/dist/device/ceilinglight.d.ts.map +1 -1
  15. package/dist/device/ceilinglight.js +110 -64
  16. package/dist/device/ceilinglight.js.map +1 -1
  17. package/dist/device/colorbulb.d.ts +10 -6
  18. package/dist/device/colorbulb.d.ts.map +1 -1
  19. package/dist/device/colorbulb.js +121 -69
  20. package/dist/device/colorbulb.js.map +1 -1
  21. package/dist/device/contact.d.ts +10 -6
  22. package/dist/device/contact.d.ts.map +1 -1
  23. package/dist/device/contact.js +111 -66
  24. package/dist/device/contact.js.map +1 -1
  25. package/dist/device/curtain.d.ts +10 -6
  26. package/dist/device/curtain.d.ts.map +1 -1
  27. package/dist/device/curtain.js +165 -107
  28. package/dist/device/curtain.js.map +1 -1
  29. package/dist/device/hub.d.ts +10 -6
  30. package/dist/device/hub.d.ts.map +1 -1
  31. package/dist/device/hub.js +88 -51
  32. package/dist/device/hub.js.map +1 -1
  33. package/dist/device/humidifier.d.ts +10 -6
  34. package/dist/device/humidifier.d.ts.map +1 -1
  35. package/dist/device/humidifier.js +133 -90
  36. package/dist/device/humidifier.js.map +1 -1
  37. package/dist/device/iosensor.d.ts +10 -6
  38. package/dist/device/iosensor.d.ts.map +1 -1
  39. package/dist/device/iosensor.js +109 -66
  40. package/dist/device/iosensor.js.map +1 -1
  41. package/dist/device/lightstrip.d.ts +10 -6
  42. package/dist/device/lightstrip.d.ts.map +1 -1
  43. package/dist/device/lightstrip.js +110 -65
  44. package/dist/device/lightstrip.js.map +1 -1
  45. package/dist/device/lock.d.ts +11 -7
  46. package/dist/device/lock.d.ts.map +1 -1
  47. package/dist/device/lock.js +125 -84
  48. package/dist/device/lock.js.map +1 -1
  49. package/dist/device/meter.d.ts +10 -6
  50. package/dist/device/meter.d.ts.map +1 -1
  51. package/dist/device/meter.js +103 -63
  52. package/dist/device/meter.js.map +1 -1
  53. package/dist/device/meterplus.d.ts +10 -6
  54. package/dist/device/meterplus.d.ts.map +1 -1
  55. package/dist/device/meterplus.js +103 -63
  56. package/dist/device/meterplus.js.map +1 -1
  57. package/dist/device/motion.d.ts +10 -6
  58. package/dist/device/motion.d.ts.map +1 -1
  59. package/dist/device/motion.js +95 -54
  60. package/dist/device/motion.js.map +1 -1
  61. package/dist/device/plug.d.ts +10 -6
  62. package/dist/device/plug.d.ts.map +1 -1
  63. package/dist/device/plug.js +68 -40
  64. package/dist/device/plug.js.map +1 -1
  65. package/dist/device/robotvacuumcleaner.d.ts +10 -6
  66. package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
  67. package/dist/device/robotvacuumcleaner.js +86 -52
  68. package/dist/device/robotvacuumcleaner.js.map +1 -1
  69. package/dist/homebridge-ui/server.js +5 -10
  70. package/dist/homebridge-ui/server.js.map +1 -1
  71. package/dist/index.d.ts +1 -4
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +9 -5
  74. package/dist/index.js.map +1 -1
  75. package/dist/irdevice/airconditioner.d.ts +9 -5
  76. package/dist/irdevice/airconditioner.d.ts.map +1 -1
  77. package/dist/irdevice/airconditioner.js +105 -71
  78. package/dist/irdevice/airconditioner.js.map +1 -1
  79. package/dist/irdevice/airpurifier.d.ts +9 -5
  80. package/dist/irdevice/airpurifier.d.ts.map +1 -1
  81. package/dist/irdevice/airpurifier.js +78 -46
  82. package/dist/irdevice/airpurifier.js.map +1 -1
  83. package/dist/irdevice/camera.d.ts +9 -5
  84. package/dist/irdevice/camera.d.ts.map +1 -1
  85. package/dist/irdevice/camera.js +41 -25
  86. package/dist/irdevice/camera.js.map +1 -1
  87. package/dist/irdevice/fan.d.ts +9 -5
  88. package/dist/irdevice/fan.d.ts.map +1 -1
  89. package/dist/irdevice/fan.js +62 -39
  90. package/dist/irdevice/fan.js.map +1 -1
  91. package/dist/irdevice/light.d.ts +9 -5
  92. package/dist/irdevice/light.d.ts.map +1 -1
  93. package/dist/irdevice/light.js +67 -45
  94. package/dist/irdevice/light.js.map +1 -1
  95. package/dist/irdevice/other.d.ts +9 -5
  96. package/dist/irdevice/other.d.ts.map +1 -1
  97. package/dist/irdevice/other.js +176 -150
  98. package/dist/irdevice/other.js.map +1 -1
  99. package/dist/irdevice/tv.d.ts +9 -5
  100. package/dist/irdevice/tv.d.ts.map +1 -1
  101. package/dist/irdevice/tv.js +81 -62
  102. package/dist/irdevice/tv.js.map +1 -1
  103. package/dist/irdevice/vacuumcleaner.d.ts +9 -5
  104. package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
  105. package/dist/irdevice/vacuumcleaner.js +41 -25
  106. package/dist/irdevice/vacuumcleaner.js.map +1 -1
  107. package/dist/irdevice/waterheater.d.ts +9 -5
  108. package/dist/irdevice/waterheater.d.ts.map +1 -1
  109. package/dist/irdevice/waterheater.js +48 -32
  110. package/dist/irdevice/waterheater.js.map +1 -1
  111. package/dist/platform.d.ts +8 -9
  112. package/dist/platform.d.ts.map +1 -1
  113. package/dist/platform.js +151 -162
  114. package/dist/platform.js.map +1 -1
  115. package/dist/settings.js +7 -14
  116. package/dist/settings.js.map +1 -1
  117. package/dist/utils.js +1 -5
  118. package/dist/utils.js.map +1 -1
  119. package/package.json +20 -9
  120. package/src/device/blindtilt.ts +84 -72
  121. package/src/device/bot.ts +191 -180
  122. package/src/device/ceilinglight.ts +57 -44
  123. package/src/device/colorbulb.ts +53 -40
  124. package/src/device/contact.ts +71 -60
  125. package/src/device/curtain.ts +98 -86
  126. package/src/device/hub.ts +57 -45
  127. package/src/device/humidifier.ts +88 -77
  128. package/src/device/iosensor.ts +67 -55
  129. package/src/device/lightstrip.ts +56 -43
  130. package/src/device/lock.ts +91 -81
  131. package/src/device/meter.ts +63 -51
  132. package/src/device/meterplus.ts +67 -55
  133. package/src/device/motion.ts +58 -47
  134. package/src/device/plug.ts +38 -27
  135. package/src/device/robotvacuumcleaner.ts +49 -38
  136. package/src/index.ts +10 -7
  137. package/src/irdevice/airconditioner.ts +71 -63
  138. package/src/irdevice/airpurifier.ts +48 -40
  139. package/src/irdevice/camera.ts +28 -20
  140. package/src/irdevice/fan.ts +42 -34
  141. package/src/irdevice/light.ts +48 -40
  142. package/src/irdevice/other.ts +164 -156
  143. package/src/irdevice/tv.ts +66 -58
  144. package/src/irdevice/vacuumcleaner.ts +28 -20
  145. package/src/irdevice/waterheater.ts +35 -27
  146. package/src/platform.ts +65 -47
  147. package/tsconfig.json +11 -13
package/src/device/hub.ts CHANGED
@@ -1,13 +1,17 @@
1
- import { connectAsync } from 'async-mqtt';
2
- import { CharacteristicValue, PlatformAccessory, Service, Units } from 'homebridge';
1
+ import asyncmqtt from 'async-mqtt';
2
+ import { CharacteristicValue, PlatformAccessory, Service, Units, API, Logging, HAP } from 'homebridge';
3
3
  import { MqttClient } from 'mqtt';
4
4
  import { hostname } from 'os';
5
5
  import { interval } from 'rxjs';
6
6
  import { request } from 'undici';
7
- import { SwitchBotPlatform } from '../platform';
8
- import { Devices, device, deviceStatus, devicesConfig } from '../settings';
7
+ import { SwitchBotPlatform } from '../platform.js';
8
+ import { Devices, device, deviceStatus, devicesConfig, SwitchBotPlatformConfig } from '../settings.js';
9
9
 
10
10
  export class Hub {
11
+ public readonly api: API;
12
+ public readonly log: Logging;
13
+ public readonly config!: SwitchBotPlatformConfig;
14
+ protected readonly hap: HAP;
11
15
  // Services
12
16
  lightSensorService?: Service;
13
17
  humidityService?: Service;
@@ -44,21 +48,28 @@ export class Hub {
44
48
  deviceRefreshRate!: number;
45
49
 
46
50
  // Connection
47
- private readonly BLE = this.device.connectionType === 'BLE' || this.device.connectionType === 'BLE/OpenAPI';
48
- private readonly OpenAPI = this.device.connectionType === 'OpenAPI' || this.device.connectionType === 'BLE/OpenAPI';
51
+ private readonly OpenAPI: boolean;
52
+ private readonly BLE: boolean;
49
53
 
50
54
  constructor(
51
55
  private readonly platform: SwitchBotPlatform,
52
56
  private accessory: PlatformAccessory,
53
57
  public device: device & devicesConfig,
54
58
  ) {
59
+ this.api = this.platform.api;
60
+ this.log = this.platform.log;
61
+ this.config = this.platform.config;
62
+ this.hap = this.api.hap;
63
+ // Connection
64
+ this.BLE = this.device.connectionType === 'BLE' || this.device.connectionType === 'BLE/OpenAPI';
65
+ this.OpenAPI = this.device.connectionType === 'OpenAPI' || this.device.connectionType === 'BLE/OpenAPI';
55
66
  // default placeholders
56
- this.logs(device);
67
+ this.deviceLogs(device);
57
68
  this.refreshRate(device);
58
69
  this.context();
59
70
  this.setupHistoryService(device);
60
71
  this.setupMqtt(device);
61
- this.config(device);
72
+ this.deviceConfig(device);
62
73
 
63
74
  this.CurrentRelativeHumidity = accessory.context.CurrentRelativeHumidity;
64
75
  this.CurrentTemperature = accessory.context.CurrentTemperature;
@@ -68,29 +79,29 @@ export class Hub {
68
79
 
69
80
  // set accessory information
70
81
  accessory
71
- .getService(this.platform.Service.AccessoryInformation)!
72
- .setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
73
- .setCharacteristic(this.platform.Characteristic.Model, accessory.context.model)
74
- .setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId)
75
- .setCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision);
82
+ .getService(this.hap.Service.AccessoryInformation)!
83
+ .setCharacteristic(this.hap.Characteristic.Manufacturer, 'SwitchBot')
84
+ .setCharacteristic(this.hap.Characteristic.Model, accessory.context.model)
85
+ .setCharacteristic(this.hap.Characteristic.SerialNumber, device.deviceId)
86
+ .setCharacteristic(this.hap.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision);
76
87
 
77
88
  // Temperature Sensor Service
78
89
  if (device.hub?.hide_temperature) {
79
90
  this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Removing Temperature Sensor Service`);
80
- this.temperatureService = this.accessory.getService(this.platform.Service.TemperatureSensor);
91
+ this.temperatureService = this.accessory.getService(this.hap.Service.TemperatureSensor);
81
92
  accessory.removeService(this.temperatureService!);
82
93
  } else if (!this.temperatureService) {
83
94
  this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Add Temperature Sensor Service`);
84
95
  const temperatureService = `${accessory.displayName} Temperature Sensor`;
85
- (this.temperatureService = this.accessory.getService(this.platform.Service.TemperatureSensor)
86
- || this.accessory.addService(this.platform.Service.TemperatureSensor)), temperatureService;
96
+ (this.temperatureService = this.accessory.getService(this.hap.Service.TemperatureSensor)
97
+ || this.accessory.addService(this.hap.Service.TemperatureSensor)), temperatureService;
87
98
 
88
- this.temperatureService.setCharacteristic(this.platform.Characteristic.Name, `${accessory.displayName} Temperature Sensor`);
89
- if (!this.temperatureService.testCharacteristic(this.platform.Characteristic.ConfiguredName)) {
90
- this.temperatureService.addCharacteristic(this.platform.Characteristic.ConfiguredName, `${accessory.displayName} Temperature Sensor`);
99
+ this.temperatureService.setCharacteristic(this.hap.Characteristic.Name, `${accessory.displayName} Temperature Sensor`);
100
+ if (!this.temperatureService.testCharacteristic(this.hap.Characteristic.ConfiguredName)) {
101
+ this.temperatureService.addCharacteristic(this.hap.Characteristic.ConfiguredName, `${accessory.displayName} Temperature Sensor`);
91
102
  }
92
103
  this.temperatureService
93
- .getCharacteristic(this.platform.Characteristic.CurrentTemperature)
104
+ .getCharacteristic(this.hap.Characteristic.CurrentTemperature)
94
105
  .setProps({
95
106
  unit: Units['CELSIUS'],
96
107
  validValueRanges: [-273.15, 100],
@@ -108,20 +119,20 @@ export class Hub {
108
119
  // Humidity Sensor Service
109
120
  if (device.hub?.hide_humidity) {
110
121
  this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Removing Humidity Sensor Service`);
111
- this.humidityService = this.accessory.getService(this.platform.Service.HumiditySensor);
122
+ this.humidityService = this.accessory.getService(this.hap.Service.HumiditySensor);
112
123
  accessory.removeService(this.humidityService!);
113
124
  } else if (!this.humidityService) {
114
125
  this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Add Humidity Sensor Service`);
115
126
  const humidityService = `${accessory.displayName} Humidity Sensor`;
116
- (this.humidityService = this.accessory.getService(this.platform.Service.HumiditySensor)
117
- || this.accessory.addService(this.platform.Service.HumiditySensor)), humidityService;
127
+ (this.humidityService = this.accessory.getService(this.hap.Service.HumiditySensor)
128
+ || this.accessory.addService(this.hap.Service.HumiditySensor)), humidityService;
118
129
 
119
- this.humidityService.setCharacteristic(this.platform.Characteristic.Name, `${accessory.displayName} Humidity Sensor`);
120
- if (!this.humidityService.testCharacteristic(this.platform.Characteristic.ConfiguredName)) {
121
- this.humidityService.addCharacteristic(this.platform.Characteristic.ConfiguredName, `${accessory.displayName} Humidity Sensor`);
130
+ this.humidityService.setCharacteristic(this.hap.Characteristic.Name, `${accessory.displayName} Humidity Sensor`);
131
+ if (!this.humidityService.testCharacteristic(this.hap.Characteristic.ConfiguredName)) {
132
+ this.humidityService.addCharacteristic(this.hap.Characteristic.ConfiguredName, `${accessory.displayName} Humidity Sensor`);
122
133
  }
123
134
  this.humidityService
124
- .getCharacteristic(this.platform.Characteristic.CurrentRelativeHumidity)
135
+ .getCharacteristic(this.hap.Characteristic.CurrentRelativeHumidity)
125
136
  .setProps({
126
137
  minStep: 0.1,
127
138
  })
@@ -135,16 +146,16 @@ export class Hub {
135
146
  // Light Sensor Service
136
147
  if (device.hub?.hide_lightsensor) {
137
148
  this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Removing Light Sensor Service`);
138
- this.lightSensorService = this.accessory.getService(this.platform.Service.LightSensor);
149
+ this.lightSensorService = this.accessory.getService(this.hap.Service.LightSensor);
139
150
  accessory.removeService(this.lightSensorService!);
140
151
  } else if (!this.lightSensorService) {
141
152
  this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Add Light Sensor Service`);
142
153
  const lightSensorService = `${accessory.displayName} Light Sensor`;
143
- (this.lightSensorService = this.accessory.getService(this.platform.Service.LightSensor)
144
- || this.accessory.addService(this.platform.Service.LightSensor)), lightSensorService;
154
+ (this.lightSensorService = this.accessory.getService(this.hap.Service.LightSensor)
155
+ || this.accessory.addService(this.hap.Service.LightSensor)), lightSensorService;
145
156
 
146
- this.lightSensorService.setCharacteristic(this.platform.Characteristic.Name, `${accessory.displayName} Light Sensor`);
147
- this.lightSensorService.setCharacteristic(this.platform.Characteristic.ConfiguredName, `${accessory.displayName} Light Sensor`);
157
+ this.lightSensorService.setCharacteristic(this.hap.Characteristic.Name, `${accessory.displayName} Light Sensor`);
158
+ this.lightSensorService.setCharacteristic(this.hap.Characteristic.ConfiguredName, `${accessory.displayName} Light Sensor`);
148
159
  } else {
149
160
  this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Light Sensor Service Not Added`);
150
161
  }
@@ -168,9 +179,9 @@ export class Hub {
168
179
  const { temperature, humidity, lightLevel } = context;
169
180
  const { CurrentTemperature, CurrentRelativeHumidity, CurrentAmbientLightLevel } = this;
170
181
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} ` +
171
- '(temperature, humidity, lightLevel) = ' +
172
- `Webhook:(${temperature}, ${humidity}, ${lightLevel}), ` +
173
- `current:(${CurrentTemperature}, ${CurrentRelativeHumidity}, ${CurrentAmbientLightLevel})`);
182
+ '(temperature, humidity, lightLevel) = ' +
183
+ `Webhook:(${temperature}, ${humidity}, ${lightLevel}), ` +
184
+ `current:(${CurrentTemperature}, ${CurrentRelativeHumidity}, ${CurrentAmbientLightLevel})`);
174
185
  this.CurrentRelativeHumidity = humidity;
175
186
  this.CurrentTemperature = temperature;
176
187
  this.set_minLux = this.minLux();
@@ -265,7 +276,7 @@ export class Hub {
265
276
  }
266
277
  } catch (e: any) {
267
278
  this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
268
- + `failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e}`);
279
+ + `failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e}`);
269
280
  }
270
281
  };
271
282
  }
@@ -396,7 +407,7 @@ export class Hub {
396
407
  );
397
408
  }
398
409
  if (!this.device.hub?.hide_lightsensor) {
399
- this.lightSensorService?.setCharacteristic(this.platform.Characteristic.CurrentAmbientLightLevel, this.CurrentAmbientLightLevel);
410
+ this.lightSensorService?.setCharacteristic(this.hap.Characteristic.CurrentAmbientLightLevel, this.CurrentAmbientLightLevel);
400
411
  }
401
412
  }
402
413
 
@@ -469,7 +480,7 @@ export class Hub {
469
480
  entry['humidity'] = this.CurrentRelativeHumidity;
470
481
  }
471
482
  this.accessory.context.CurrentRelativeHumidity = this.CurrentRelativeHumidity;
472
- this.humidityService?.updateCharacteristic(this.platform.Characteristic.CurrentRelativeHumidity, this.CurrentRelativeHumidity);
483
+ this.humidityService?.updateCharacteristic(this.hap.Characteristic.CurrentRelativeHumidity, this.CurrentRelativeHumidity);
473
484
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
474
485
  + `updateCharacteristic CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`);
475
486
  }
@@ -487,7 +498,7 @@ export class Hub {
487
498
  entry['temp'] = this.CurrentTemperature;
488
499
  }
489
500
  this.accessory.context.CurrentTemperature = this.CurrentTemperature;
490
- this.temperatureService?.updateCharacteristic(this.platform.Characteristic.CurrentTemperature, this.CurrentTemperature);
501
+ this.temperatureService?.updateCharacteristic(this.hap.Characteristic.CurrentTemperature, this.CurrentTemperature);
491
502
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic CurrentTemperature: ${this.CurrentTemperature}`);
492
503
  }
493
504
  }
@@ -504,7 +515,7 @@ export class Hub {
504
515
  entry['lux'] = this.CurrentAmbientLightLevel;
505
516
  }
506
517
  this.accessory.context.CurrentAmbientLightLevel = this.CurrentAmbientLightLevel;
507
- this.lightSensorService?.updateCharacteristic(this.platform.Characteristic.CurrentAmbientLightLevel, this.CurrentAmbientLightLevel);
518
+ this.lightSensorService?.updateCharacteristic(this.hap.Characteristic.CurrentAmbientLightLevel, this.CurrentAmbientLightLevel);
508
519
  this.debugLog(
509
520
  `${this.device.deviceType}: ${this.accessory.displayName} `
510
521
  + `updateCharacteristic CurrentAmbientLightLevel: ${this.CurrentAmbientLightLevel}`,
@@ -544,6 +555,7 @@ export class Hub {
544
555
  async setupMqtt(device: device & devicesConfig): Promise<void> {
545
556
  if (device.mqttURL) {
546
557
  try {
558
+ const { connectAsync } = asyncmqtt;
547
559
  this.mqttClient = await connectAsync(device.mqttURL, device.mqttOptions || {});
548
560
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} MQTT connection has been established successfully.`);
549
561
  this.mqttClient.on('error', (e: Error) => {
@@ -624,13 +636,13 @@ export class Hub {
624
636
 
625
637
  async apiError(e: any): Promise<void> {
626
638
  if (!this.device.hub?.hide_temperature) {
627
- this.temperatureService?.updateCharacteristic(this.platform.Characteristic.CurrentTemperature, e);
639
+ this.temperatureService?.updateCharacteristic(this.hap.Characteristic.CurrentTemperature, e);
628
640
  }
629
641
  if (!this.device.hub?.hide_humidity) {
630
- this.humidityService?.updateCharacteristic(this.platform.Characteristic.CurrentRelativeHumidity, e);
642
+ this.humidityService?.updateCharacteristic(this.hap.Characteristic.CurrentRelativeHumidity, e);
631
643
  }
632
644
  if (!this.device.hub?.hide_lightsensor) {
633
- this.lightSensorService?.updateCharacteristic(this.platform.Characteristic.CurrentAmbientLightLevel, e);
645
+ this.lightSensorService?.updateCharacteristic(this.hap.Characteristic.CurrentAmbientLightLevel, e);
634
646
  }
635
647
  }
636
648
 
@@ -693,7 +705,7 @@ export class Hub {
693
705
  }
694
706
  }
695
707
 
696
- async config(device: device & devicesConfig): Promise<void> {
708
+ async deviceConfig(device: device & devicesConfig): Promise<void> {
697
709
  let config = {};
698
710
  if (device.hub) {
699
711
  config = device.hub;
@@ -715,7 +727,7 @@ export class Hub {
715
727
  }
716
728
  }
717
729
 
718
- async logs(device: device & devicesConfig): Promise<void> {
730
+ async deviceLogs(device: device & devicesConfig): Promise<void> {
719
731
  if (this.platform.debugMode) {
720
732
  this.deviceLogging = this.accessory.context.logging = 'debugMode';
721
733
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);