homebridge-tasmota-control 0.3.38 → 0.3.41-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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
- ## [0.0.1] - (24.12.2021)
6
+ ## [0.3.38] - (25.12.2021)
7
+ ## Changs
8
+ - update config.schema
9
+
10
+ ## [0.3.38] - (24.12.2021)
7
11
  ## Changs
8
12
  - initial release
package/README.md CHANGED
@@ -18,7 +18,7 @@ Homebridge plugin for Tasmota flashed devices.
18
18
  | --- | --- | --- | --- |
19
19
  | [Homebridge](https://github.com/homebridge/homebridge) | [Homebridge Wiki](https://github.com/homebridge/homebridge/wiki) | HomeKit Bridge | Required |
20
20
  | [Config UI X](https://github.com/oznu/homebridge-config-ui-x/wiki) | [Config UI X Wiki](https://github.com/oznu/homebridge-config-ui-x/wiki) | Web User Interface | Recommended |
21
- | [OpenWebIf TV](https://www.npmjs.com/package/homebridge-tasmota-control) | `npm install -g homebridge-tasmota-control` | Plug-In | Required |
21
+ | [Tasmota Control](https://www.npmjs.com/package/homebridge-tasmota-control) | `npm install -g homebridge-tasmota-control` | Plug-In | Required |
22
22
 
23
23
  ## Note
24
24
  * Right now only switch/outlets devices are supported.
@@ -33,11 +33,11 @@ Install and use [Homebridge Config UI X](https://github.com/oznu/homebridge-conf
33
33
  | Key | Description |
34
34
  | --- | --- |
35
35
  | `name` | Here set the accessory *Name* to be displayed in *Homebridge/HomeKit*. |
36
- | `host` | Here set the *Hsostname or Address IP* of Sat Receiver.|
36
+ | `host` | Here set the *Hsostname or Address IP* of the Device.|
37
37
  | `auth` | If enabled, authorizatins credentials will be used for login. |
38
38
  | `user` | Here set the authorization *Username*. |
39
39
  | `passwd` | Here set the authorization *Password*. |
40
- | `channelsCount` | Here set number of channels of device. |
40
+ | `channelsCount` | Here select the channels count. |
41
41
  | `enableDebugMode` | This enable deep log in homebridge console. |
42
42
  | `disableLogInfo` | This disable log info, all values and state will not be displayed in Homebridge log console. |
43
43
 
@@ -69,13 +69,6 @@ Each accessory needs to be manually paired.
69
69
  5. Enter the Homebridge PIN or scan the QR code, this can be found in Homebridge UI or Homebridge logs.
70
70
  6. Complete the accessory setup.
71
71
 
72
- ## Limitations
73
- * That maximum Services for 1 accessory is 100. If Services > 100, accessory stop responding.
74
- * To solved this problem the plugin couts the number of Services and not allow add more as 100.
75
- * If You have configured more as 100 Services some inputs or button will not be available in the Home app.
76
- * The Services in this accessory are:
77
- * Outlets
78
-
79
72
  ## [What's New](https://github.com/grzegorz914/homebridge-tasmota-control/blob/master/CHANGELOG.md)
80
73
 
81
74
  ## Development
@@ -54,11 +54,59 @@
54
54
  },
55
55
  "channelsCount": {
56
56
  "title": "Channels count",
57
- "type": "number",
58
- "default": 1,
57
+ "type": "integer",
59
58
  "minimum": 1,
60
- "maximum": 4,
61
- "description": "Here set the number of channels.",
59
+ "maximum": 8,
60
+ "description": "Here select the channels count.",
61
+ "oneOf": [{
62
+ "title": "1CH",
63
+ "enum": [
64
+ 1
65
+ ]
66
+ },
67
+ {
68
+ "title": "2CH",
69
+ "enum": [
70
+ 2
71
+ ]
72
+ },
73
+ {
74
+ "title": "3CH",
75
+ "enum": [
76
+ 3
77
+ ]
78
+ },
79
+ {
80
+ "title": "4CH",
81
+ "enum": [
82
+ 4
83
+ ]
84
+ },
85
+ {
86
+ "title": "5CH",
87
+ "enum": [
88
+ 5
89
+ ]
90
+ },
91
+ {
92
+ "title": "6CH",
93
+ "enum": [
94
+ 6
95
+ ]
96
+ },
97
+ {
98
+ "title": "7CH",
99
+ "enum": [
100
+ 7
101
+ ]
102
+ },
103
+ {
104
+ "title": "8CH",
105
+ "enum": [
106
+ 8
107
+ ]
108
+ }
109
+ ],
62
110
  "required": true
63
111
  },
64
112
  "enableDebugMode": {
package/index.js CHANGED
@@ -210,13 +210,17 @@ class tasmotaDevice {
210
210
  const powerOn = this.channelsCount == 1 ? POWER + ON : POWER + (i + 1) + ON;
211
211
  const powerOff = this.channelsCount == 1 ? POWER + OFF : POWER + (i + 1) + OFF;
212
212
  state = state ? powerOn : powerOff;
213
- this.axiosInstance(state);
214
- const logInfo = this.disableLogInfo ? false : this.log('Device: %s %s, set state: %s', this.host, accessoryName, state ? 'ON' : 'OFF');
213
+ try {
214
+ await this.axiosInstance(state);
215
+ const logInfo = this.disableLogInfo ? false : this.log('Device: %s %s, set state: %s', this.host, accessoryName, state ? 'ON' : 'OFF');
216
+ } catch (error) {
217
+ this.log.error('Device: %s %s, set state: %s', this.host, this.name, error);
218
+ }
215
219
  });
216
220
  tasmotaService.getCharacteristic(Characteristic.OutletInUse)
217
221
  .onGet(async () => {
218
222
  const state = this.powerState[i];
219
- const logInfo = this.disableLogInfo ? false : this.log('Device: %s %s, in use: %s', this.host, accessoryName, state ? 'YES' : 'NO');
223
+ const logInfo = this.disableLogInfo ? false : this.log('Device: %s %s, in use state: %s', this.host, accessoryName, state ? 'YES' : 'NO');
220
224
  return state;
221
225
  });
222
226
  this.tasmotaServices.push(tasmotaService);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Tasmota Control",
3
3
  "name": "homebridge-tasmota-control",
4
- "version": "0.3.38",
4
+ "version": "0.3.41-beta.0",
5
5
  "description": "Homebridge plugin (https://github.com/homebridge/homebridge) to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",