homebridge-tasmota-control 0.4.32 → 0.4.33

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 (2) hide show
  1. package/index.js +9 -14
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -36,33 +36,28 @@ class tasmotaPlatform {
36
36
  log(`No configuration found for ${PLUGIN_NAME}.`);
37
37
  return;
38
38
  };
39
-
40
- this.log = log;
41
- this.api = api;
42
39
  this.accessories = [];
43
- const devices = config.devices;
44
40
 
45
- this.api.on('didFinishLaunching', () => {
46
- this.log.debug('didFinishLaunching');
47
- for (const device of devices) {
41
+ api.on('didFinishLaunching', () => {
42
+ for (const device of config.devices) {
48
43
  if (!device.name || !device.host) {
49
- this.log.warn('Device name or host missing!');
44
+ log.warn('Device name or host missing!');
50
45
  return;
51
46
  }
47
+
48
+ //debug config
49
+ const debug = device.enableDebugMode ? log(`Device: ${device.host} ${device.name}, did finish launching.`) : false;
50
+ const debug1 = device.enableDebugMode ? log(`Device: ${device.host} ${device.name}, Config: ${JSON.stringify(device, null, 2)}`) : false;
51
+
52
+ //tasmota device
52
53
  new tasmotaDevice(this.log, device, this.api);
53
54
  };
54
55
  });
55
56
  };
56
57
 
57
58
  configureAccessory(accessory) {
58
- this.log.debug('configureAccessory');
59
59
  this.accessories.push(accessory);
60
60
  };
61
-
62
- removeAccessory(accessory) {
63
- this.log.debug('removeAccessory');
64
- this.api.unregisterPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory]);
65
- };
66
61
  };
67
62
 
68
63
  class tasmotaDevice {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Tasmota Control",
3
3
  "name": "homebridge-tasmota-control",
4
- "version": "0.4.32",
4
+ "version": "0.4.33",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",