homebridge-tasmota-control 1.1.0 → 1.1.2

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.
package/index.js CHANGED
@@ -1,7 +1,5 @@
1
- 'use strict';
2
- import fs from 'fs';
3
1
  import { join } from 'path';
4
- import { mkdirSync } from 'fs';
2
+ import { mkdirSync, existsSync, writeFileSync } from 'fs';
5
3
  import TasmotaDevice from './src/tasmotadevice.js';
6
4
  import ImpulseGenerator from './src/impulsegenerator.js';
7
5
  import { PluginName, PlatformName } from './src/constants.js';
@@ -56,9 +54,9 @@ class tasmotaPlatform {
56
54
  ];
57
55
 
58
56
  files.forEach((file, index) => {
59
- if (!fs.existsSync(file)) {
57
+ if (!existsSync(file)) {
60
58
  const data = ['20', '23'][index]
61
- fs.writeFileSync(file, data);
59
+ writeFileSync(file, data);
62
60
  }
63
61
  });
64
62
  } catch (error) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Tasmota Control",
3
3
  "name": "homebridge-tasmota-control",
4
- "version": "1.1.0",
4
+ "version": "1.1.2",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -17,7 +17,9 @@
17
17
  "url": "https://github.com/grzegorz914/homebridge-tasmota-control/issues"
18
18
  },
19
19
  "type": "module",
20
- "main": "index.js",
20
+ "exports": {
21
+ ".": "./index.js"
22
+ },
21
23
  "files": [
22
24
  "src",
23
25
  "index.js",
@@ -32,7 +34,7 @@
32
34
  "node": "^18.20.4 || ^20.15.1 || ^22.7.0 || ^23.2.0"
33
35
  },
34
36
  "dependencies": {
35
- "axios": "^1.7.8"
37
+ "axios": "^1.7.9"
36
38
  },
37
39
  "keywords": [
38
40
  "homebridge",
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  import EventEmitter from 'events';
3
2
 
4
3
  class ImpulseGenerator extends EventEmitter {
@@ -1,6 +1,4 @@
1
- 'use strict';
2
- import { promises } from 'fs';
3
- const fsPromises = promises;
1
+ import { promises as fsPromises } from 'fs';
4
2
  import axios from 'axios';
5
3
  import EventEmitter from 'events';
6
4
  import ImpulseGenerator from './impulsegenerator.js';