homebridge-tasmota-control 1.6.15-beta.28 → 1.6.15-beta.29
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/package.json +1 -1
- package/src/fans.js +16 -15
- package/src/lights.js +21 -20
- package/src/mielhvac.js +28 -26
- package/src/sensors.js +16 -15
- package/src/switches.js +16 -15
package/package.json
CHANGED
package/src/fans.js
CHANGED
|
@@ -43,21 +43,22 @@ class Fans extends EventEmitter {
|
|
|
43
43
|
|
|
44
44
|
//impulse generator
|
|
45
45
|
this.call = false;
|
|
46
|
-
this.impulseGenerator = new ImpulseGenerator()
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
46
|
+
this.impulseGenerator = new ImpulseGenerator()
|
|
47
|
+
.on('checkDeviceState', async () => {
|
|
48
|
+
if (this.call) return;
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
this.call = true;
|
|
52
|
+
await this.checkDeviceState();
|
|
53
|
+
this.call = false;
|
|
54
|
+
} catch (error) {
|
|
55
|
+
this.call = false;
|
|
56
|
+
this.emit('error', `Inpulse generator error: ${error}`);
|
|
57
|
+
};
|
|
58
|
+
})
|
|
59
|
+
.on('state', (state) => {
|
|
60
|
+
this.emit('success', `Impulse generator ${state ? 'started' : 'stopped'}.`);
|
|
61
|
+
});
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
async checkDeviceState() {
|
package/src/lights.js
CHANGED
|
@@ -41,21 +41,22 @@ class Lights extends EventEmitter {
|
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
this.call = false;
|
|
44
|
-
this.impulseGenerator = new ImpulseGenerator()
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
44
|
+
this.impulseGenerator = new ImpulseGenerator()
|
|
45
|
+
.on('checkDeviceState', async () => {
|
|
46
|
+
if (this.call) return;
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
this.call = true;
|
|
50
|
+
await this.checkDeviceState();
|
|
51
|
+
this.call = false;
|
|
52
|
+
} catch (error) {
|
|
53
|
+
this.call = false;
|
|
54
|
+
this.emit('error', `Inpulse generator error: ${error}`);
|
|
55
|
+
};
|
|
56
|
+
})
|
|
57
|
+
.on('state', (state) => {
|
|
58
|
+
this.emit('success', `Impulse generator ${state ? 'started' : 'stopped'}.`);
|
|
59
|
+
});
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
async checkDeviceState() {
|
|
@@ -144,10 +145,10 @@ class Lights extends EventEmitter {
|
|
|
144
145
|
//log info
|
|
145
146
|
if (!this.disableLogInfo) {
|
|
146
147
|
this.emit('info', `${friendlyName}, state: ${power ? 'ON' : 'OFF'}`);
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
if (brightnessType !== 0) this.emit('info', `${friendlyName}, brightness: ${bright} %`);
|
|
149
|
+
if (colorTemperature) this.emit('info', `${friendlyName}, color temperatur: ${colorTemperature}`);
|
|
150
|
+
if (hue) this.emit('info', `${friendlyName}, hue: ${hue}`);
|
|
151
|
+
if (saturation) this.emit('info', `${friendlyName}, saturation: ${saturation}`);
|
|
151
152
|
}
|
|
152
153
|
}
|
|
153
154
|
}
|
|
@@ -186,7 +187,7 @@ class Lights extends EventEmitter {
|
|
|
186
187
|
async startImpulseGenerator() {
|
|
187
188
|
try {
|
|
188
189
|
//start impulse generator
|
|
189
|
-
const timers = [{ name: 'checkDeviceState', sampling: this.refreshInterval }];
|
|
190
|
+
const timers = [{ name: 'checkDeviceState', sampling: this.refreshInterval }];
|
|
190
191
|
await this.impulseGenerator.start(timers);
|
|
191
192
|
return true;
|
|
192
193
|
} catch (error) {
|
package/src/mielhvac.js
CHANGED
|
@@ -150,31 +150,33 @@ class MiElHvac extends EventEmitter {
|
|
|
150
150
|
//impulse generator
|
|
151
151
|
this.call = false;
|
|
152
152
|
this.call1 = false;
|
|
153
|
-
this.impulseGenerator = new ImpulseGenerator()
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
153
|
+
this.impulseGenerator = new ImpulseGenerator()
|
|
154
|
+
.on('checkDeviceState', async () => {
|
|
155
|
+
if (this.call) return;
|
|
156
|
+
|
|
157
|
+
try {
|
|
158
|
+
this.call = true;
|
|
159
|
+
await this.checkDeviceState();
|
|
160
|
+
this.call = false;
|
|
161
|
+
} catch (error) {
|
|
162
|
+
this.call = false;
|
|
163
|
+
this.emit('error', `Inpulse generator error: ${error}`);
|
|
164
|
+
};
|
|
165
|
+
})
|
|
166
|
+
.on('updateRemoteTemp', async () => {
|
|
167
|
+
if (this.call1) return;
|
|
168
|
+
|
|
169
|
+
try {
|
|
170
|
+
this.call1 = true;
|
|
171
|
+
await this.updateRemoteTemp();
|
|
172
|
+
} catch (error) {
|
|
173
|
+
this.call1 = false;
|
|
174
|
+
this.emit('error', `Impulse generator error: ${error}`);
|
|
175
|
+
}
|
|
176
|
+
})
|
|
177
|
+
.on('state', (state) => {
|
|
178
|
+
this.emit('success', `Impulse generator ${state ? 'started' : 'stopped'}.`);
|
|
179
|
+
});
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
async checkDeviceState() {
|
|
@@ -746,7 +748,7 @@ class MiElHvac extends EventEmitter {
|
|
|
746
748
|
try {
|
|
747
749
|
//start impulse generator
|
|
748
750
|
const timers = [{ name: 'checkDeviceState', sampling: this.refreshInterval }];
|
|
749
|
-
|
|
751
|
+
if (this.remoteTemperatureSensorEnable) timers.push({ name: 'updateRemoteTemp', sampling: this.remoteTemperatureSensorRefreshInterval });
|
|
750
752
|
await this.impulseGenerator.start(timers);
|
|
751
753
|
return true;
|
|
752
754
|
} catch (error) {
|
package/src/sensors.js
CHANGED
|
@@ -44,21 +44,22 @@ class Sensors extends EventEmitter {
|
|
|
44
44
|
|
|
45
45
|
//impulse generator
|
|
46
46
|
this.call = false;
|
|
47
|
-
this.impulseGenerator = new ImpulseGenerator()
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
47
|
+
this.impulseGenerator = new ImpulseGenerator()
|
|
48
|
+
.on('checkDeviceState', async () => {
|
|
49
|
+
if (this.call) return;
|
|
50
|
+
|
|
51
|
+
try {
|
|
52
|
+
this.call = true;
|
|
53
|
+
await this.checkDeviceState();
|
|
54
|
+
this.call = false;
|
|
55
|
+
} catch (error) {
|
|
56
|
+
this.call = false;
|
|
57
|
+
this.emit('error', `Inpulse generator error: ${error}`);
|
|
58
|
+
};
|
|
59
|
+
})
|
|
60
|
+
.on('state', (state) => {
|
|
61
|
+
this.emit('success', `Impulse generator ${state ? 'started' : 'stopped'}.`);
|
|
62
|
+
});
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
async checkDeviceState() {
|
package/src/switches.js
CHANGED
|
@@ -43,21 +43,22 @@ class Switches extends EventEmitter {
|
|
|
43
43
|
|
|
44
44
|
//impulse generator
|
|
45
45
|
this.call = false;
|
|
46
|
-
this.impulseGenerator = new ImpulseGenerator()
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
46
|
+
this.impulseGenerator = new ImpulseGenerator()
|
|
47
|
+
.on('checkDeviceState', async () => {
|
|
48
|
+
if (this.call) return;
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
this.call = true;
|
|
52
|
+
await this.checkDeviceState();
|
|
53
|
+
this.call = false;
|
|
54
|
+
} catch (error) {
|
|
55
|
+
this.call = false;
|
|
56
|
+
this.emit('error', `Inpulse generator error: ${error}`);
|
|
57
|
+
};
|
|
58
|
+
})
|
|
59
|
+
.on('state', (state) => {
|
|
60
|
+
this.emit('success', `Impulse generator ${state ? 'started' : 'stopped'}.`);
|
|
61
|
+
});
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
async checkDeviceState() {
|