homebridge-tasmota-control 1.4.0-beta.38 → 1.4.0-beta.39
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 +7 -8
- package/package.json +1 -1
- package/src/mielhvac.js +7 -11
package/index.js
CHANGED
|
@@ -78,7 +78,7 @@ class tasmotaPlatform {
|
|
|
78
78
|
|
|
79
79
|
const info = await deviceInfo.getInfo();
|
|
80
80
|
if (!info.serialNumber) {
|
|
81
|
-
log.warn(`
|
|
81
|
+
log.warn(`Device: ${host} ${deviceName}, serial not found.`);
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
84
|
|
|
@@ -86,14 +86,13 @@ class tasmotaPlatform {
|
|
|
86
86
|
switch (info.deviceType) {
|
|
87
87
|
case 0://mielhvac
|
|
88
88
|
//check files exists, if not then create it
|
|
89
|
-
const postFix = device.host.split('.').join('');
|
|
90
|
-
const defaultHeatingSetTemperatureFile = `${prefDir}/defaultHeatingSetTemperature_${postFix}`;
|
|
91
|
-
const defaultCoolingSetTemperatureFile = `${prefDir}/defaultCoolingSetTemperature_${postFix}`;
|
|
92
|
-
|
|
93
89
|
try {
|
|
90
|
+
const postFix = device.host.split('.').join('');
|
|
91
|
+
info.defaultHeatingSetTemperatureFile = `${prefDir}/defaultHeatingSetTemperature_${postFix}`;
|
|
92
|
+
info.defaultCoolingSetTemperatureFile = `${prefDir}/defaultCoolingSetTemperature_${postFix}`;
|
|
94
93
|
const files = [
|
|
95
|
-
defaultHeatingSetTemperatureFile,
|
|
96
|
-
defaultCoolingSetTemperatureFile
|
|
94
|
+
info.defaultHeatingSetTemperatureFile,
|
|
95
|
+
info.defaultCoolingSetTemperatureFile
|
|
97
96
|
];
|
|
98
97
|
|
|
99
98
|
files.forEach((file, index) => {
|
|
@@ -107,7 +106,7 @@ class tasmotaPlatform {
|
|
|
107
106
|
return;
|
|
108
107
|
}
|
|
109
108
|
|
|
110
|
-
deviceType = new mielhvac(api, device, info, refreshInterval
|
|
109
|
+
deviceType = new mielhvac(api, device, info, refreshInterval);
|
|
111
110
|
break;
|
|
112
111
|
case 1://switches
|
|
113
112
|
deviceType = new switches(api, device, info, refreshInterval);
|
package/package.json
CHANGED
package/src/mielhvac.js
CHANGED
|
@@ -6,7 +6,7 @@ import { ApiCommands, MiElHVAC, TemperatureDisplayUnits } from './constants.js';
|
|
|
6
6
|
let Accessory, Characteristic, Service, Categories, AccessoryUUID;
|
|
7
7
|
|
|
8
8
|
class MiElHvac extends EventEmitter {
|
|
9
|
-
constructor(api, config, info, refreshInterval
|
|
9
|
+
constructor(api, config, info, refreshInterval) {
|
|
10
10
|
super();
|
|
11
11
|
|
|
12
12
|
Accessory = api.platformAccessory;
|
|
@@ -113,10 +113,6 @@ class MiElHvac extends EventEmitter {
|
|
|
113
113
|
this.disableLogDeviceInfo = config.disableLogDeviceInfo || false;
|
|
114
114
|
this.refreshInterval = refreshInterval;
|
|
115
115
|
|
|
116
|
-
//files
|
|
117
|
-
this.defaultHeatingSetTemperatureFile = defaultHeatingSetTemperatureFile;
|
|
118
|
-
this.defaultCoolingSetTemperatureFile = defaultCoolingSetTemperatureFile;
|
|
119
|
-
|
|
120
116
|
//variable
|
|
121
117
|
this.startPrepareAccessory = true;
|
|
122
118
|
|
|
@@ -219,8 +215,8 @@ class MiElHvac extends EventEmitter {
|
|
|
219
215
|
const operationEnergy = miElHvac.OperationEnergy ?? 0;
|
|
220
216
|
const operationStage = miElHvac.OperationStage ?? 'Unknown';
|
|
221
217
|
const swingMode = vaneVerticalDirection === 'swing' && vaneHorizontalDirection === 'swing' ? 1 : 0;
|
|
222
|
-
const defaultCoolingSetTemperature = parseFloat(await this.readData(this.defaultCoolingSetTemperatureFile));
|
|
223
|
-
const defaultHeatingSetTemperature = parseFloat(await this.readData(this.defaultHeatingSetTemperatureFile));
|
|
218
|
+
const defaultCoolingSetTemperature = parseFloat(await this.readData(this.info.defaultCoolingSetTemperatureFile));
|
|
219
|
+
const defaultHeatingSetTemperature = parseFloat(await this.readData(this.info.defaultHeatingSetTemperatureFile));
|
|
224
220
|
const remoteTemperatureSensorState = miElHvac.RemoteTemperatureSensorState ?? false; //ON, OFF
|
|
225
221
|
const remoteTemperatureSensorAutoClearTime = miElHvac.RemoteTemperatureSensorAutoClearTime ?? 0; //time in ms
|
|
226
222
|
|
|
@@ -990,8 +986,8 @@ class MiElHvac extends EventEmitter {
|
|
|
990
986
|
.onSet(async (value) => {
|
|
991
987
|
try {
|
|
992
988
|
if (this.mielHvac.targetOperationMode === 0) {
|
|
993
|
-
await this.saveData(this.defaultCoolingSetTemperatureFile, value);
|
|
994
|
-
value = (value + this.mielHvac.defaultHeatingSetTemperature) / 2;
|
|
989
|
+
await this.saveData(this.info.defaultCoolingSetTemperatureFile, value);
|
|
990
|
+
value = (value + this.info.mielHvac.defaultHeatingSetTemperature) / 2;
|
|
995
991
|
}
|
|
996
992
|
|
|
997
993
|
const temp = `${MiElHVAC.SetTemp}${value}`
|
|
@@ -1015,8 +1011,8 @@ class MiElHvac extends EventEmitter {
|
|
|
1015
1011
|
.onSet(async (value) => {
|
|
1016
1012
|
try {
|
|
1017
1013
|
if (this.mielHvac.targetOperationMode === 0) {
|
|
1018
|
-
await this.saveData(this.defaultHeatingSetTemperatureFile, value);
|
|
1019
|
-
value = (value + this.mielHvac.defaultCoolingSetTemperature) / 2;
|
|
1014
|
+
await this.saveData(this.info.defaultHeatingSetTemperatureFile, value);
|
|
1015
|
+
value = (value + this.info.mielHvac.defaultCoolingSetTemperature) / 2;
|
|
1020
1016
|
}
|
|
1021
1017
|
|
|
1022
1018
|
const temp = `${MiElHVAC.SetTemp}${value}`
|