zigbee-herdsman-converters 23.3.0 → 23.4.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 +20 -0
- package/dist/converters/fromZigbee.d.ts.map +1 -1
- package/dist/converters/fromZigbee.js +53 -11
- package/dist/converters/fromZigbee.js.map +1 -1
- package/dist/converters/toZigbee.d.ts.map +1 -1
- package/dist/converters/toZigbee.js +82 -8
- package/dist/converters/toZigbee.js.map +1 -1
- package/dist/devices/ITCommander.d.ts.map +1 -1
- package/dist/devices/ITCommander.js +1 -0
- package/dist/devices/ITCommander.js.map +1 -1
- package/dist/devices/adeo.d.ts.map +1 -1
- package/dist/devices/adeo.js +1 -0
- package/dist/devices/adeo.js.map +1 -1
- package/dist/devices/atlantic.d.ts.map +1 -1
- package/dist/devices/atlantic.js +2 -0
- package/dist/devices/atlantic.js.map +1 -1
- package/dist/devices/avatto.js +6 -6
- package/dist/devices/avatto.js.map +1 -1
- package/dist/devices/bosch.d.ts.map +1 -1
- package/dist/devices/bosch.js +2 -0
- package/dist/devices/bosch.js.map +1 -1
- package/dist/devices/busch_jaeger.js +1 -1
- package/dist/devices/busch_jaeger.js.map +1 -1
- package/dist/devices/custom_devices_diy.d.ts.map +1 -1
- package/dist/devices/custom_devices_diy.js +18 -13
- package/dist/devices/custom_devices_diy.js.map +1 -1
- package/dist/devices/develco.js +1 -1
- package/dist/devices/develco.js.map +1 -1
- package/dist/devices/diyruz.d.ts.map +1 -1
- package/dist/devices/diyruz.js +2 -0
- package/dist/devices/diyruz.js.map +1 -1
- package/dist/devices/essentials.js +3 -3
- package/dist/devices/essentials.js.map +1 -1
- package/dist/devices/ewelink.d.ts.map +1 -1
- package/dist/devices/ewelink.js +15 -37
- package/dist/devices/ewelink.js.map +1 -1
- package/dist/devices/gledopto.d.ts.map +1 -1
- package/dist/devices/gledopto.js +2 -1
- package/dist/devices/gledopto.js.map +1 -1
- package/dist/devices/gmmts.d.ts.map +1 -1
- package/dist/devices/gmmts.js +7 -0
- package/dist/devices/gmmts.js.map +1 -1
- package/dist/devices/hive.js +1 -1
- package/dist/devices/hive.js.map +1 -1
- package/dist/devices/ikea.js +1 -1
- package/dist/devices/ikea.js.map +1 -1
- package/dist/devices/index.js.map +1 -1
- package/dist/devices/inovelli.d.ts.map +1 -1
- package/dist/devices/inovelli.js +70 -36
- package/dist/devices/inovelli.js.map +1 -1
- package/dist/devices/insta.js +1 -1
- package/dist/devices/insta.js.map +1 -1
- package/dist/devices/keen_home.d.ts.map +1 -1
- package/dist/devices/keen_home.js +2 -4
- package/dist/devices/keen_home.js.map +1 -1
- package/dist/devices/lidl.d.ts.map +1 -1
- package/dist/devices/lidl.js +5 -2
- package/dist/devices/lidl.js.map +1 -1
- package/dist/devices/lifecontrol.js +1 -1
- package/dist/devices/lifecontrol.js.map +1 -1
- package/dist/devices/linptech.d.ts.map +1 -1
- package/dist/devices/linptech.js +1 -0
- package/dist/devices/linptech.js.map +1 -1
- package/dist/devices/lixee.d.ts.map +1 -1
- package/dist/devices/lixee.js +69 -49
- package/dist/devices/lixee.js.map +1 -1
- package/dist/devices/lumi.d.ts.map +1 -1
- package/dist/devices/lumi.js +20 -91
- package/dist/devices/lumi.js.map +1 -1
- package/dist/devices/muller_licht.d.ts.map +1 -1
- package/dist/devices/muller_licht.js +1 -5
- package/dist/devices/muller_licht.js.map +1 -1
- package/dist/devices/multiterm.d.ts.map +1 -1
- package/dist/devices/multiterm.js +1 -0
- package/dist/devices/multiterm.js.map +1 -1
- package/dist/devices/namron.js +2 -2
- package/dist/devices/namron.js.map +1 -1
- package/dist/devices/nue_3a.d.ts.map +1 -1
- package/dist/devices/nue_3a.js +2 -0
- package/dist/devices/nue_3a.js.map +1 -1
- package/dist/devices/orvibo.d.ts.map +1 -1
- package/dist/devices/orvibo.js +3 -0
- package/dist/devices/orvibo.js.map +1 -1
- package/dist/devices/osram.js +2 -2
- package/dist/devices/osram.js.map +1 -1
- package/dist/devices/owon.d.ts.map +1 -1
- package/dist/devices/owon.js +2 -0
- package/dist/devices/owon.js.map +1 -1
- package/dist/devices/philips.d.ts.map +1 -1
- package/dist/devices/philips.js +7 -0
- package/dist/devices/philips.js.map +1 -1
- package/dist/devices/rgb_genie.d.ts.map +1 -1
- package/dist/devices/rgb_genie.js +2 -0
- package/dist/devices/rgb_genie.js.map +1 -1
- package/dist/devices/samotech.d.ts.map +1 -1
- package/dist/devices/samotech.js +2 -1
- package/dist/devices/samotech.js.map +1 -1
- package/dist/devices/schneider_electric.d.ts.map +1 -1
- package/dist/devices/schneider_electric.js +8 -4
- package/dist/devices/schneider_electric.js.map +1 -1
- package/dist/devices/shinasystem.d.ts.map +1 -1
- package/dist/devices/shinasystem.js +3 -0
- package/dist/devices/shinasystem.js.map +1 -1
- package/dist/devices/sinope.d.ts.map +1 -1
- package/dist/devices/sinope.js +3 -0
- package/dist/devices/sinope.js.map +1 -1
- package/dist/devices/sonoff.d.ts.map +1 -1
- package/dist/devices/sonoff.js +2 -4
- package/dist/devices/sonoff.js.map +1 -1
- package/dist/devices/sunricher.d.ts.map +1 -1
- package/dist/devices/sunricher.js +17 -743
- package/dist/devices/sunricher.js.map +1 -1
- package/dist/devices/third_reality.d.ts.map +1 -1
- package/dist/devices/third_reality.js +1 -4
- package/dist/devices/third_reality.js.map +1 -1
- package/dist/devices/tuya.d.ts.map +1 -1
- package/dist/devices/tuya.js +42 -20
- package/dist/devices/tuya.js.map +1 -1
- package/dist/devices/ubisys.d.ts.map +1 -1
- package/dist/devices/ubisys.js +6 -1
- package/dist/devices/ubisys.js.map +1 -1
- package/dist/devices/xyzroe.d.ts.map +1 -1
- package/dist/devices/xyzroe.js +10 -0
- package/dist/devices/xyzroe.js.map +1 -1
- package/dist/devices/yale.js +1 -1
- package/dist/devices/yale.js.map +1 -1
- package/dist/devices/yandex.js +1 -1
- package/dist/devices/yandex.js.map +1 -1
- package/dist/devices/yokis.d.ts.map +1 -1
- package/dist/devices/yokis.js +74 -37
- package/dist/devices/yokis.js.map +1 -1
- package/dist/devices/ysrsai.js +1 -1
- package/dist/devices/ysrsai.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/indexer.d.ts.map +1 -1
- package/dist/indexer.js +1 -0
- package/dist/indexer.js.map +1 -1
- package/dist/lib/color.d.ts.map +1 -1
- package/dist/lib/color.js +9 -1
- package/dist/lib/color.js.map +1 -1
- package/dist/lib/configureKey.js +9 -0
- package/dist/lib/configureKey.js.map +1 -1
- package/dist/lib/develco.d.ts.map +1 -1
- package/dist/lib/develco.js +1 -0
- package/dist/lib/develco.js.map +1 -1
- package/dist/lib/ewelink.d.ts.map +1 -1
- package/dist/lib/ewelink.js +10 -7
- package/dist/lib/ewelink.js.map +1 -1
- package/dist/lib/exposes.d.ts +17 -17
- package/dist/lib/exposes.d.ts.map +1 -1
- package/dist/lib/exposes.js +50 -30
- package/dist/lib/exposes.js.map +1 -1
- package/dist/lib/generateDefinition.d.ts.map +1 -1
- package/dist/lib/generateDefinition.js +2 -1
- package/dist/lib/generateDefinition.js.map +1 -1
- package/dist/lib/ikea.d.ts.map +1 -1
- package/dist/lib/ikea.js +8 -0
- package/dist/lib/ikea.js.map +1 -1
- package/dist/lib/ledvance.d.ts.map +1 -1
- package/dist/lib/ledvance.js +2 -0
- package/dist/lib/ledvance.js.map +1 -1
- package/dist/lib/legacy.d.ts +2 -2
- package/dist/lib/legacy.d.ts.map +1 -1
- package/dist/lib/legacy.js +177 -3
- package/dist/lib/legacy.js.map +1 -1
- package/dist/lib/light.d.ts.map +1 -1
- package/dist/lib/light.js +2 -0
- package/dist/lib/light.js.map +1 -1
- package/dist/lib/lumi.d.ts +2 -2
- package/dist/lib/lumi.d.ts.map +1 -1
- package/dist/lib/lumi.js +56 -4
- package/dist/lib/lumi.js.map +1 -1
- package/dist/lib/modernExtend.d.ts +7 -6
- package/dist/lib/modernExtend.d.ts.map +1 -1
- package/dist/lib/modernExtend.js +78 -3
- package/dist/lib/modernExtend.js.map +1 -1
- package/dist/lib/ota.d.ts.map +1 -1
- package/dist/lib/ota.js +10 -1
- package/dist/lib/ota.js.map +1 -1
- package/dist/lib/philips.d.ts +1 -1
- package/dist/lib/philips.d.ts.map +1 -1
- package/dist/lib/philips.js +20 -1
- package/dist/lib/philips.js.map +1 -1
- package/dist/lib/reporting.d.ts.map +1 -1
- package/dist/lib/reporting.js +0 -1
- package/dist/lib/reporting.js.map +1 -1
- package/dist/lib/sunricher.d.ts +17 -3
- package/dist/lib/sunricher.d.ts.map +1 -1
- package/dist/lib/sunricher.js +771 -1
- package/dist/lib/sunricher.js.map +1 -1
- package/dist/lib/tuya.d.ts +5 -5
- package/dist/lib/tuya.d.ts.map +1 -1
- package/dist/lib/tuya.js +21 -6
- package/dist/lib/tuya.js.map +1 -1
- package/dist/lib/types.d.ts +3 -3
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/types.js +0 -1
- package/dist/lib/types.js.map +1 -1
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +17 -5
- package/dist/lib/utils.js.map +1 -1
- package/dist/models-index.json +1 -1
- package/package.json +1 -1
package/dist/lib/legacy.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
3
|
if (k2 === undefined) k2 = k;
|
|
5
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -54,6 +53,7 @@ const dataTypes = {
|
|
|
54
53
|
enum: 4, // [ 0-255 ]
|
|
55
54
|
bitmap: 5, // [ 1,2,4 bytes ] as bits
|
|
56
55
|
};
|
|
56
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
57
57
|
const convertMultiByteNumberPayloadToSingleDecimalNumber = (chunks) => {
|
|
58
58
|
// Destructuring "chunks" is needed because it's a Buffer
|
|
59
59
|
// and we need a simple array.
|
|
@@ -64,6 +64,7 @@ const convertMultiByteNumberPayloadToSingleDecimalNumber = (chunks) => {
|
|
|
64
64
|
}
|
|
65
65
|
return value;
|
|
66
66
|
};
|
|
67
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
67
68
|
function getDataValue(dpValue) {
|
|
68
69
|
let dataString = "";
|
|
69
70
|
switch (dpValue.datatype) {
|
|
@@ -85,20 +86,24 @@ function getDataValue(dpValue) {
|
|
|
85
86
|
return convertMultiByteNumberPayloadToSingleDecimalNumber(dpValue.data);
|
|
86
87
|
}
|
|
87
88
|
}
|
|
89
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
88
90
|
function getTypeName(dpValue) {
|
|
89
91
|
const entry = Object.entries(dataTypes).find(([typeName, typeId]) => typeId === dpValue.datatype);
|
|
90
92
|
return entry ? entry[0] : "unknown";
|
|
91
93
|
}
|
|
94
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
92
95
|
function logUnexpectedDataPoint(where, msg, dpValue, meta) {
|
|
93
96
|
logger_1.logger.debug(`Received unexpected Tuya DataPoint #${dpValue.dp} from ${meta.device.ieeeAddr} with raw data '${JSON.stringify(dpValue)}': \
|
|
94
97
|
type='${msg.type}', datatype='${getTypeName(dpValue)}', value='${getDataValue(dpValue)}', known DP# usage: \
|
|
95
98
|
${JSON.stringify(getDataPointNames(dpValue))}`, `zhc:${where}`);
|
|
96
99
|
}
|
|
100
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
97
101
|
function logUnexpectedDataType(where, msg, dpValue, meta, expectedDataType) {
|
|
98
102
|
logger_1.logger.debug(`Received Tuya DataPoint #${dpValue.dp} with unexpected datatype from ${meta.device.ieeeAddr} with raw data \
|
|
99
103
|
'${JSON.stringify(dpValue)}': type='${msg.type}', datatype='${getTypeName(dpValue)}' (instead of '${expectedDataType}'), \
|
|
100
104
|
value='${getDataValue(dpValue)}', known DP# usage: ${JSON.stringify(getDataPointNames(dpValue))}`, `zhc:${where}`);
|
|
101
105
|
}
|
|
106
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
102
107
|
function getDataPointNames(dpValue) {
|
|
103
108
|
const entries = Object.entries(dataPoints).filter(([dpName, dpId]) => dpId === dpValue.dp);
|
|
104
109
|
return entries.map(([dpName, dpId]) => dpName);
|
|
@@ -107,9 +112,13 @@ const coverStateOverride = {
|
|
|
107
112
|
// Contains all covers which differentiate from the default enum states
|
|
108
113
|
// Use manufacturerName to identify device!
|
|
109
114
|
// https://github.com/Koenkk/zigbee2mqtt/issues/5596#issuecomment-759408189
|
|
115
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
110
116
|
_TZE200_rddyvrci: { close: 1, open: 2, stop: 0 },
|
|
117
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
111
118
|
_TZE200_wmcdj3aq: { close: 0, open: 2, stop: 1 },
|
|
119
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
112
120
|
_TZE200_cowvfni3: { close: 0, open: 2, stop: 1 },
|
|
121
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
113
122
|
_TYST11_cowvfni3: { close: 0, open: 2, stop: 1 },
|
|
114
123
|
};
|
|
115
124
|
// Gets an array containing which enums have to be used in order for the correct close/open/stop commands to be sent
|
|
@@ -128,6 +137,7 @@ function convertDecimalValueTo4ByteHexArray(value) {
|
|
|
128
137
|
return [chunk1, chunk2, chunk3, chunk4].map((hexVal) => Number.parseInt(hexVal, 16));
|
|
129
138
|
}
|
|
130
139
|
let gSec = undefined;
|
|
140
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
131
141
|
async function sendDataPoints(entity, dpValues, cmd = "dataRequest", seq = undefined) {
|
|
132
142
|
if (seq === undefined) {
|
|
133
143
|
if (gSec === undefined) {
|
|
@@ -137,6 +147,7 @@ async function sendDataPoints(entity, dpValues, cmd = "dataRequest", seq = undef
|
|
|
137
147
|
gSec++;
|
|
138
148
|
gSec %= 0xffff;
|
|
139
149
|
}
|
|
150
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
140
151
|
seq = gSec;
|
|
141
152
|
}
|
|
142
153
|
await entity.command("manuSpecificTuya", cmd || "dataRequest", {
|
|
@@ -164,16 +175,20 @@ function dpValueFromEnum(dp, value) {
|
|
|
164
175
|
function dpValueFromStringBuffer(dp, stringBuffer) {
|
|
165
176
|
return { dp, datatype: dataTypes.string, data: stringBuffer };
|
|
166
177
|
}
|
|
178
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
167
179
|
function dpValueFromRaw(dp, rawBuffer) {
|
|
168
180
|
return { dp, datatype: dataTypes.raw, data: rawBuffer };
|
|
169
181
|
}
|
|
182
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
170
183
|
function dpValueFromBitmap(dp, bitmapBuffer) {
|
|
171
184
|
return { dp, datatype: dataTypes.bitmap, data: bitmapBuffer };
|
|
172
185
|
}
|
|
173
186
|
// Return `seq` - transaction ID for handling concrete response
|
|
187
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
174
188
|
async function sendDataPoint(entity, dpValue, cmd, seq = undefined) {
|
|
175
189
|
return await sendDataPoints(entity, [dpValue], cmd, seq);
|
|
176
190
|
}
|
|
191
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
177
192
|
async function sendDataPointValue(entity, dp, value, cmd, seq = undefined) {
|
|
178
193
|
return await sendDataPoints(entity, [dpValueFromIntValue(dp, value)], cmd, seq);
|
|
179
194
|
}
|
|
@@ -183,15 +198,19 @@ async function sendDataPointBool(entity, dp, value, cmd, seq = undefined) {
|
|
|
183
198
|
async function sendDataPointEnum(entity, dp, value, cmd, seq = undefined) {
|
|
184
199
|
return await sendDataPoints(entity, [dpValueFromEnum(dp, value)], cmd, seq);
|
|
185
200
|
}
|
|
201
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
186
202
|
async function sendDataPointRaw(entity, dp, value, cmd, seq = undefined) {
|
|
187
203
|
return await sendDataPoints(entity, [dpValueFromRaw(dp, value)], cmd, seq);
|
|
188
204
|
}
|
|
205
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
189
206
|
async function sendDataPointBitmap(entity, dp, value, cmd, seq = undefined) {
|
|
190
207
|
return await sendDataPoints(entity, [dpValueFromBitmap(dp, value)], cmd, seq);
|
|
191
208
|
}
|
|
209
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
192
210
|
async function sendDataPointStringBuffer(entity, dp, value, cmd, seq = undefined) {
|
|
193
211
|
return await sendDataPoints(entity, [dpValueFromStringBuffer(dp, value)], cmd, seq);
|
|
194
212
|
}
|
|
213
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
195
214
|
function convertRawToCycleTimer(value) {
|
|
196
215
|
let timernr = 0;
|
|
197
216
|
let starttime = "00:00";
|
|
@@ -216,6 +235,7 @@ function convertRawToCycleTimer(value) {
|
|
|
216
235
|
else {
|
|
217
236
|
weekdays = "once";
|
|
218
237
|
}
|
|
238
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
219
239
|
let minsincemidnight = value[4] * 256 + value[5];
|
|
220
240
|
// @ts-expect-error ignore
|
|
221
241
|
starttime = `${String(Number.parseInt(minsincemidnight / 60)).padStart(2, "0")}:${String(minsincemidnight % 60).padStart(2, "0")}`;
|
|
@@ -235,6 +255,7 @@ function convertRawToCycleTimer(value) {
|
|
|
235
255
|
active: timeractive,
|
|
236
256
|
};
|
|
237
257
|
}
|
|
258
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
238
259
|
function logDataPoint(where, msg, dpValue, meta) {
|
|
239
260
|
logger_1.logger.info(`Received Tuya DataPoint #${dpValue.dp} from ${meta.device.ieeeAddr} with raw data '${JSON.stringify(dpValue)}': \
|
|
240
261
|
type='${msg.type}', datatype='${getTypeName(dpValue)}', value='${getDataValue(dpValue)}', known DP# usage: \
|
|
@@ -432,6 +453,7 @@ function convertWeekdaysTo1ByteHexArray(weekdays) {
|
|
|
432
453
|
}
|
|
433
454
|
return [nr];
|
|
434
455
|
}
|
|
456
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
435
457
|
function convertRawToTimer(value) {
|
|
436
458
|
let timernr = 0;
|
|
437
459
|
let starttime = "00:00";
|
|
@@ -461,7 +483,15 @@ function convertRawToTimer(value) {
|
|
|
461
483
|
}
|
|
462
484
|
return { timernr: timernr, time: starttime, duration: duration, weekdays: weekdays, active: timeractive };
|
|
463
485
|
}
|
|
464
|
-
function logUnexpectedDataValue(where, msg,
|
|
486
|
+
function logUnexpectedDataValue(where, msg,
|
|
487
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
488
|
+
dpValue, meta,
|
|
489
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
490
|
+
valueKind,
|
|
491
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
492
|
+
expectedMinValue = null,
|
|
493
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
494
|
+
expectedMaxValue = null) {
|
|
465
495
|
if (expectedMinValue === null) {
|
|
466
496
|
if (expectedMaxValue === null) {
|
|
467
497
|
logger_1.logger.debug(`Received Tuya DataPoint #${dpValue.dp} with invalid value ${getDataValue(dpValue)} for ${valueKind} \
|
|
@@ -502,6 +532,7 @@ function isCoverInverted(manufacturerName) {
|
|
|
502
532
|
// Return false by default, not inverted
|
|
503
533
|
return coverPositionInvert.includes(manufacturerName);
|
|
504
534
|
}
|
|
535
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
505
536
|
function convertDecimalValueTo2ByteHexArray(value) {
|
|
506
537
|
const hexValue = Number(value).toString(16).padStart(4, "0");
|
|
507
538
|
const chunk1 = hexValue.substr(0, 2);
|
|
@@ -597,6 +628,7 @@ const dataPoints = {
|
|
|
597
628
|
moesSboostHeating: 4,
|
|
598
629
|
moesSboostHeatingCountdown: 5,
|
|
599
630
|
moesSreset: 7,
|
|
631
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
600
632
|
moesSwindowDetectionFunktion_A2: 8,
|
|
601
633
|
moesSwindowDetection: 9,
|
|
602
634
|
moesSchildLock: 13,
|
|
@@ -1005,6 +1037,7 @@ const dataPoints = {
|
|
|
1005
1037
|
zsScheduleSunday: 115,
|
|
1006
1038
|
};
|
|
1007
1039
|
exports.dataPoints = dataPoints;
|
|
1040
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
1008
1041
|
function firstDpValue(msg, meta, converterName) {
|
|
1009
1042
|
const dpValues = msg.data.dpValues;
|
|
1010
1043
|
for (let index = 1; index < dpValues.length; index++) {
|
|
@@ -1014,6 +1047,7 @@ function firstDpValue(msg, meta, converterName) {
|
|
|
1014
1047
|
}
|
|
1015
1048
|
return dpValues[0];
|
|
1016
1049
|
}
|
|
1050
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
1017
1051
|
function getMetaValue(entity, definition, key, groupStrategy = "first") {
|
|
1018
1052
|
if (entity.constructor.name === "Group" && entity.members.length > 0) {
|
|
1019
1053
|
const values = [];
|
|
@@ -1042,6 +1076,7 @@ const CAPACITY = "capacity";
|
|
|
1042
1076
|
const DURATION = "duration";
|
|
1043
1077
|
const OFF = "OFF";
|
|
1044
1078
|
const ON = "ON";
|
|
1079
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
1045
1080
|
const toLocalTime = (time, timezone) => {
|
|
1046
1081
|
if (time === "--:--:--") {
|
|
1047
1082
|
return time;
|
|
@@ -1052,12 +1087,14 @@ const toLocalTime = (time, timezone) => {
|
|
|
1052
1087
|
const giexFzModelConverters = {
|
|
1053
1088
|
QT06_1: {
|
|
1054
1089
|
// _TZE200_sh1btabb timezone is GMT+8
|
|
1090
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
1055
1091
|
time: (value) => toLocalTime(value, "+08:00"),
|
|
1056
1092
|
},
|
|
1057
1093
|
};
|
|
1058
1094
|
const giexTzModelConverters = {
|
|
1059
1095
|
QT06_2: {
|
|
1060
1096
|
// _TZE200_a7sghmms irrigation time should not be less than 10 secs as per GiEX advice
|
|
1097
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
1061
1098
|
irrigationTarget: (value, mode) => (value > 0 && value < SAFETY_MIN_SECS && mode === DURATION ? SAFETY_MIN_SECS : value),
|
|
1062
1099
|
},
|
|
1063
1100
|
};
|
|
@@ -1144,6 +1181,7 @@ const fromZigbee = {
|
|
|
1144
1181
|
return result;
|
|
1145
1182
|
},
|
|
1146
1183
|
},
|
|
1184
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
1147
1185
|
ZM35HQ_battery: {
|
|
1148
1186
|
cluster: "manuSpecificTuya",
|
|
1149
1187
|
type: ["commandDataReport"],
|
|
@@ -1201,6 +1239,7 @@ const fromZigbee = {
|
|
|
1201
1239
|
return result;
|
|
1202
1240
|
},
|
|
1203
1241
|
},
|
|
1242
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
1204
1243
|
R7049_status: {
|
|
1205
1244
|
cluster: "manuSpecificTuya",
|
|
1206
1245
|
type: ["commandDataResponse", "commandDataReport"],
|
|
@@ -1245,6 +1284,7 @@ const fromZigbee = {
|
|
|
1245
1284
|
return result;
|
|
1246
1285
|
},
|
|
1247
1286
|
},
|
|
1287
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
1248
1288
|
woox_R7060: {
|
|
1249
1289
|
cluster: "manuSpecificTuya",
|
|
1250
1290
|
type: ["commandActiveStatusReport"],
|
|
@@ -1649,6 +1689,7 @@ const fromZigbee = {
|
|
|
1649
1689
|
const dp = dpValue.dp;
|
|
1650
1690
|
const value = getDataValue(dpValue);
|
|
1651
1691
|
const stateLookup = { "0": "cool", "1": "heat", "2": "fan_only" };
|
|
1692
|
+
// biome-ignore lint/suspicious/noImplicitAnyLet: ignored using `--suppress`
|
|
1652
1693
|
let temperature;
|
|
1653
1694
|
/* See tuyaThermostat above for message structure comment */
|
|
1654
1695
|
switch (dp) {
|
|
@@ -1777,6 +1818,7 @@ const fromZigbee = {
|
|
|
1777
1818
|
}
|
|
1778
1819
|
},
|
|
1779
1820
|
},
|
|
1821
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
1780
1822
|
moesS_thermostat: {
|
|
1781
1823
|
cluster: "manuSpecificTuya",
|
|
1782
1824
|
type: ["commandDataResponse", "commandDataReport"],
|
|
@@ -1891,6 +1933,7 @@ const fromZigbee = {
|
|
|
1891
1933
|
}
|
|
1892
1934
|
},
|
|
1893
1935
|
},
|
|
1936
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
1894
1937
|
tuya_CO: {
|
|
1895
1938
|
cluster: "manuSpecificTuya",
|
|
1896
1939
|
type: ["commandDataReport", "commandDataResponse"],
|
|
@@ -2652,6 +2695,7 @@ const fromZigbee = {
|
|
|
2652
2695
|
return result;
|
|
2653
2696
|
},
|
|
2654
2697
|
},
|
|
2698
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
2655
2699
|
ZMAM02_cover: {
|
|
2656
2700
|
cluster: "manuSpecificTuya",
|
|
2657
2701
|
type: ["commandDataReport", "commandDataResponse"],
|
|
@@ -2817,6 +2861,7 @@ const fromZigbee = {
|
|
|
2817
2861
|
return result;
|
|
2818
2862
|
},
|
|
2819
2863
|
},
|
|
2864
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
2820
2865
|
ZG204ZL_lms: {
|
|
2821
2866
|
cluster: "manuSpecificTuya",
|
|
2822
2867
|
type: ["commandDataResponse", "commandDataReport"],
|
|
@@ -3231,6 +3276,7 @@ const fromZigbee = {
|
|
|
3231
3276
|
}
|
|
3232
3277
|
},
|
|
3233
3278
|
},
|
|
3279
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
3234
3280
|
ZB006X_settings: {
|
|
3235
3281
|
cluster: "manuSpecificTuya",
|
|
3236
3282
|
type: ["commandActiveStatusReport", "commandActiveStatusReportAlt"],
|
|
@@ -3654,10 +3700,12 @@ const fromZigbee = {
|
|
|
3654
3700
|
const maxTransitions = thermostatMeta.weeklyScheduleMaxTransitions;
|
|
3655
3701
|
let dataOffset = 0;
|
|
3656
3702
|
let conversion = "generic";
|
|
3703
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
3657
3704
|
function dataToTransitions(data, maxTransitions, offset) {
|
|
3658
3705
|
// Later it is possible to move converter to meta or to other place outside if other type of converter
|
|
3659
3706
|
// will be needed for other device. Currently this converter is based on ETOP HT-08 thermostat.
|
|
3660
3707
|
// see also toZigbee.tuya_thermostat_weekly_schedule()
|
|
3708
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
3661
3709
|
function dataToTransition(data, index) {
|
|
3662
3710
|
return {
|
|
3663
3711
|
time: (data[index + 0] << 8) + data[index + 1],
|
|
@@ -3707,6 +3755,8 @@ const fromZigbee = {
|
|
|
3707
3755
|
for (const [i, dpValue] of msg.data.dpValues.entries()) {
|
|
3708
3756
|
logDataPoint("tuya_data_point_dump", msg, dpValue, meta);
|
|
3709
3757
|
dataStr += `${now} ${meta.device.ieeeAddr} ${getHex(msg.data.seq)} ${getHex(i)} ${getHex(dpValue.dp)} ${getHex(dpValue.datatype)}`;
|
|
3758
|
+
// biome-ignore lint/complexity/noForEach: ignored using `--suppress`
|
|
3759
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
3710
3760
|
dpValue.data.forEach((elem) => {
|
|
3711
3761
|
dataStr += ` ${getHex(elem)}`;
|
|
3712
3762
|
});
|
|
@@ -3810,32 +3860,42 @@ const fromZigbee = {
|
|
|
3810
3860
|
exports.fz = fromZigbee;
|
|
3811
3861
|
exports.fromZigbee = fromZigbee;
|
|
3812
3862
|
const toZigbee1 = {
|
|
3863
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
3813
3864
|
SA12IZL_silence_siren: {
|
|
3814
3865
|
key: ["silence_siren"],
|
|
3866
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
3815
3867
|
convertSet: async (entity, key, value, meta) => {
|
|
3816
3868
|
await sendDataPointBool(entity, 16, value);
|
|
3817
3869
|
},
|
|
3818
3870
|
},
|
|
3871
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
3819
3872
|
SA12IZL_alarm: {
|
|
3820
3873
|
key: ["alarm"],
|
|
3874
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
3821
3875
|
convertSet: async (entity, key, value, meta) => {
|
|
3822
3876
|
await sendDataPointEnum(entity, 20, value ? 0 : 1);
|
|
3823
3877
|
},
|
|
3824
3878
|
},
|
|
3879
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
3825
3880
|
R7049_silenceSiren: {
|
|
3826
3881
|
key: ["silence_siren"],
|
|
3882
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
3827
3883
|
convertSet: async (entity, key, value, meta) => {
|
|
3828
3884
|
await sendDataPointBool(entity, 16, value);
|
|
3829
3885
|
},
|
|
3830
3886
|
},
|
|
3887
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
3831
3888
|
R7049_testAlarm: {
|
|
3832
3889
|
key: ["test_alarm"],
|
|
3890
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
3833
3891
|
convertSet: async (entity, key, value, meta) => {
|
|
3834
3892
|
await sendDataPointBool(entity, 8, value);
|
|
3835
3893
|
},
|
|
3836
3894
|
},
|
|
3895
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
3837
3896
|
R7049_alarm: {
|
|
3838
3897
|
key: ["alarm"],
|
|
3898
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
3839
3899
|
convertSet: async (entity, key, value, meta) => {
|
|
3840
3900
|
await sendDataPointEnum(entity, 20, value ? 0 : 1);
|
|
3841
3901
|
},
|
|
@@ -3860,6 +3920,7 @@ const toZigbee1 = {
|
|
|
3860
3920
|
},
|
|
3861
3921
|
hpsz: {
|
|
3862
3922
|
key: ["led_state"],
|
|
3923
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
3863
3924
|
convertSet: async (entity, key, value, meta) => {
|
|
3864
3925
|
await sendDataPointBool(entity, dataPoints.HPSZLEDState, value);
|
|
3865
3926
|
},
|
|
@@ -3867,12 +3928,14 @@ const toZigbee1 = {
|
|
|
3867
3928
|
tuya_cover_control: {
|
|
3868
3929
|
key: ["state", "position"],
|
|
3869
3930
|
options: [exposes.options.invert_cover()],
|
|
3931
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
3870
3932
|
convertSet: async (entity, key, value, meta) => {
|
|
3871
3933
|
// Protocol description
|
|
3872
3934
|
// https://github.com/Koenkk/zigbee-herdsman-converters/issues/1159#issuecomment-614659802
|
|
3873
3935
|
if (key === "position") {
|
|
3874
3936
|
if (value >= 0 && value <= 100) {
|
|
3875
3937
|
const invert = isCoverInverted(meta.device.manufacturerName) ? !meta.options.invert_cover : meta.options.invert_cover;
|
|
3938
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
3876
3939
|
value = invert ? 100 - value : value;
|
|
3877
3940
|
await sendDataPointValue(entity, dataPoints.coverPosition, value);
|
|
3878
3941
|
}
|
|
@@ -3883,6 +3946,7 @@ const toZigbee1 = {
|
|
|
3883
3946
|
else if (key === "state") {
|
|
3884
3947
|
const stateEnums = getCoverStateEnums(meta.device.manufacturerName);
|
|
3885
3948
|
logger_1.logger.debug(`Using state enums for ${meta.device.manufacturerName}: ${JSON.stringify(stateEnums)}`, "zhc:legacy:tz:tuya_cover_control");
|
|
3949
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
3886
3950
|
value = value.toLowerCase();
|
|
3887
3951
|
switch (value) {
|
|
3888
3952
|
case "close":
|
|
@@ -3904,10 +3968,12 @@ const toZigbee1 = {
|
|
|
3904
3968
|
const toZigbee2 = {
|
|
3905
3969
|
zb_sm_cover: {
|
|
3906
3970
|
key: ["state", "position", "reverse_direction", "top_limit", "bottom_limit", "favorite_position", "goto_positon", "report"],
|
|
3971
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
3907
3972
|
convertSet: async (entity, key, value, meta) => {
|
|
3908
3973
|
switch (key) {
|
|
3909
3974
|
case "position": {
|
|
3910
3975
|
const invert = meta.state ? !meta.state.invert_cover : false;
|
|
3976
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
3911
3977
|
value = invert ? 100 - value : value;
|
|
3912
3978
|
if (value >= 0 && value <= 100) {
|
|
3913
3979
|
await sendDataPointValue(entity, dataPoints.coverPosition, value);
|
|
@@ -3920,6 +3986,7 @@ const toZigbee2 = {
|
|
|
3920
3986
|
case "state": {
|
|
3921
3987
|
const stateEnums = getCoverStateEnums(meta.device.manufacturerName);
|
|
3922
3988
|
logger_1.logger.debug(`Using state enums for ${meta.device.manufacturerName}: ${JSON.stringify(stateEnums)}`, "zhc:legacy:tz:zb_sm_cover");
|
|
3989
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
3923
3990
|
value = value.toLowerCase();
|
|
3924
3991
|
switch (value) {
|
|
3925
3992
|
case "close":
|
|
@@ -3957,9 +4024,11 @@ const toZigbee2 = {
|
|
|
3957
4024
|
}
|
|
3958
4025
|
case "goto_positon": {
|
|
3959
4026
|
if (value === "FAVORITE") {
|
|
4027
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
3960
4028
|
value = meta.state ? meta.state.favorite_position : null;
|
|
3961
4029
|
}
|
|
3962
4030
|
else {
|
|
4031
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
3963
4032
|
value = Number.parseInt(value);
|
|
3964
4033
|
}
|
|
3965
4034
|
return await toZigbee1.tuya_cover_control.convertSet(entity, "position", value, meta);
|
|
@@ -3989,15 +4058,18 @@ const toZigbee2 = {
|
|
|
3989
4058
|
"child_lock",
|
|
3990
4059
|
"schedule",
|
|
3991
4060
|
],
|
|
4061
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
3992
4062
|
convertSet: async (entity, key, value, meta) => {
|
|
3993
4063
|
switch (key) {
|
|
3994
4064
|
case "system_mode":
|
|
3995
4065
|
await sendDataPointBool(entity, dataPoints.x5hState, value === "heat");
|
|
3996
4066
|
break;
|
|
3997
4067
|
case "preset": {
|
|
4068
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
3998
4069
|
value = value.toLowerCase();
|
|
3999
4070
|
const lookup = { manual: 0, program: 1 };
|
|
4000
4071
|
utils.validateValue(value, Object.keys(lookup));
|
|
4072
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
4001
4073
|
value = lookup[value];
|
|
4002
4074
|
await sendDataPointEnum(entity, dataPoints.x5hMode, value);
|
|
4003
4075
|
break;
|
|
@@ -4016,6 +4088,7 @@ const toZigbee2 = {
|
|
|
4016
4088
|
break;
|
|
4017
4089
|
case "deadzone_temperature":
|
|
4018
4090
|
if (value >= 0.5 && value <= 9.5) {
|
|
4091
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
4019
4092
|
value = Math.round(value * 10);
|
|
4020
4093
|
await sendDataPointValue(entity, dataPoints.x5hTempDiff, value);
|
|
4021
4094
|
}
|
|
@@ -4033,8 +4106,10 @@ const toZigbee2 = {
|
|
|
4033
4106
|
break;
|
|
4034
4107
|
case "local_temperature_calibration":
|
|
4035
4108
|
if (value >= -9.9 && value <= 9.9) {
|
|
4109
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
4036
4110
|
value = Math.round(value * 10);
|
|
4037
4111
|
if (value < 0) {
|
|
4112
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
4038
4113
|
value = 0xffffffff + value + 1;
|
|
4039
4114
|
}
|
|
4040
4115
|
await sendDataPointValue(entity, dataPoints.x5hTempCorrection, value);
|
|
@@ -4056,23 +4131,28 @@ const toZigbee2 = {
|
|
|
4056
4131
|
await sendDataPointBool(entity, dataPoints.x5hSound, value === "ON");
|
|
4057
4132
|
break;
|
|
4058
4133
|
case "brightness_state": {
|
|
4134
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
4059
4135
|
value = value.toLowerCase();
|
|
4060
4136
|
const lookup = { off: 0, low: 1, medium: 2, high: 3 };
|
|
4061
4137
|
utils.validateValue(value, Object.keys(lookup));
|
|
4138
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
4062
4139
|
value = lookup[value];
|
|
4063
4140
|
await sendDataPointEnum(entity, dataPoints.x5hBackplaneBrightness, value);
|
|
4064
4141
|
break;
|
|
4065
4142
|
}
|
|
4066
4143
|
case "sensor": {
|
|
4144
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
4067
4145
|
value = value.toLowerCase();
|
|
4068
4146
|
const lookup = { internal: 0, external: 1, both: 2 };
|
|
4069
4147
|
utils.validateValue(value, Object.keys(lookup));
|
|
4148
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
4070
4149
|
value = lookup[value];
|
|
4071
4150
|
await sendDataPointEnum(entity, dataPoints.x5hSensorSelection, value);
|
|
4072
4151
|
break;
|
|
4073
4152
|
}
|
|
4074
4153
|
case "current_heating_setpoint":
|
|
4075
4154
|
if (value >= 5 && value <= 60) {
|
|
4155
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
4076
4156
|
value = Math.round(value * 10);
|
|
4077
4157
|
await sendDataPointValue(entity, dataPoints.x5hSetTemp, value);
|
|
4078
4158
|
}
|
|
@@ -4182,6 +4262,7 @@ const toZigbee2 = {
|
|
|
4182
4262
|
},
|
|
4183
4263
|
zs_thermostat_preset_mode: {
|
|
4184
4264
|
key: ["preset"],
|
|
4265
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
4185
4266
|
convertSet: async (entity, key, value, meta) => {
|
|
4186
4267
|
const lookup = { schedule: 0, manual: 1, holiday: 2 };
|
|
4187
4268
|
if (value === "boost") {
|
|
@@ -4218,8 +4299,10 @@ const toZigbee2 = {
|
|
|
4218
4299
|
zs_thermostat_local_temperature_calibration: {
|
|
4219
4300
|
key: ["local_temperature_calibration"],
|
|
4220
4301
|
convertSet: async (entity, key, value, meta) => {
|
|
4302
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
4221
4303
|
if (value > 0)
|
|
4222
4304
|
value = value * 10;
|
|
4305
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
4223
4306
|
if (value < 0)
|
|
4224
4307
|
value = value * 10 + 0x100000000;
|
|
4225
4308
|
await sendDataPointValue(entity, dataPoints.zsTempCalibration, value);
|
|
@@ -4228,6 +4311,7 @@ const toZigbee2 = {
|
|
|
4228
4311
|
zs_thermostat_away_setting: {
|
|
4229
4312
|
key: ["away_setting"],
|
|
4230
4313
|
convertSet: async (entity, key, value, meta) => {
|
|
4314
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
4231
4315
|
const result = [];
|
|
4232
4316
|
const daysInMonth = new Date(2000 + result[0], result[1], 0).getDate();
|
|
4233
4317
|
for (const attrName of [
|
|
@@ -4295,6 +4379,7 @@ const toZigbee2 = {
|
|
|
4295
4379
|
},
|
|
4296
4380
|
zs_thermostat_local_schedule: {
|
|
4297
4381
|
key: ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"],
|
|
4382
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
4298
4383
|
convertSet: async (entity, key, value, meta) => {
|
|
4299
4384
|
const daysMap = { monday: 1, tuesday: 2, wednesday: 3, thursday: 4, friday: 5, saturday: 6, sunday: 7 };
|
|
4300
4385
|
const day = daysMap[key];
|
|
@@ -4345,8 +4430,10 @@ const toZigbee2 = {
|
|
|
4345
4430
|
results.push(Math.round(rt));
|
|
4346
4431
|
}
|
|
4347
4432
|
}
|
|
4433
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
4348
4434
|
if (value > 0)
|
|
4349
4435
|
value = value * 10;
|
|
4436
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
4350
4437
|
if (value < 0)
|
|
4351
4438
|
value = value * 10 + 0x100000000;
|
|
4352
4439
|
await sendDataPointRaw(entity, 109 + day - 1, results);
|
|
@@ -4390,6 +4477,7 @@ const toZigbee2 = {
|
|
|
4390
4477
|
},
|
|
4391
4478
|
tuya_alecto_smoke: {
|
|
4392
4479
|
key: ["self_checking", "silence"],
|
|
4480
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
4393
4481
|
convertSet: async (entity, key, value, meta) => {
|
|
4394
4482
|
switch (key) {
|
|
4395
4483
|
case "self_checking":
|
|
@@ -4435,6 +4523,7 @@ const toZigbee2 = {
|
|
|
4435
4523
|
break;
|
|
4436
4524
|
case "local_temperature_calibration":
|
|
4437
4525
|
// @ts-expect-error ignore
|
|
4526
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
4438
4527
|
if (value < 0)
|
|
4439
4528
|
value = 0xffffffff + value + 1;
|
|
4440
4529
|
await sendDataPointValue(entity, dataPoints.connecteTempCalibration, value);
|
|
@@ -4491,6 +4580,7 @@ const toZigbee2 = {
|
|
|
4491
4580
|
},
|
|
4492
4581
|
moes_thermostat_current_heating_setpoint: {
|
|
4493
4582
|
key: ["current_heating_setpoint"],
|
|
4583
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
4494
4584
|
convertSet: async (entity, key, value, meta) => {
|
|
4495
4585
|
if (["_TZE200_5toc8efa", "_TZE204_5toc8efa"].includes(meta.device.manufacturerName)) {
|
|
4496
4586
|
await sendDataPointValue(entity, dataPoints.moesHeatingSetpoint, value * 10);
|
|
@@ -4502,6 +4592,7 @@ const toZigbee2 = {
|
|
|
4502
4592
|
},
|
|
4503
4593
|
moes_thermostat_deadzone_temperature: {
|
|
4504
4594
|
key: ["deadzone_temperature"],
|
|
4595
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
4505
4596
|
convertSet: async (entity, key, value, meta) => {
|
|
4506
4597
|
if (["_TZE200_5toc8efa", "_TZE204_5toc8efa"].includes(meta.device.manufacturerName)) {
|
|
4507
4598
|
await sendDataPointValue(entity, dataPoints.moesDeadZoneTemp, value * 10);
|
|
@@ -4513,7 +4604,9 @@ const toZigbee2 = {
|
|
|
4513
4604
|
},
|
|
4514
4605
|
moes_thermostat_calibration: {
|
|
4515
4606
|
key: ["local_temperature_calibration"],
|
|
4607
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
4516
4608
|
convertSet: async (entity, key, value, meta) => {
|
|
4609
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
4517
4610
|
if (value < 0)
|
|
4518
4611
|
value = 4096 + value;
|
|
4519
4612
|
await sendDataPointValue(entity, dataPoints.moesTempCalibration, value);
|
|
@@ -4521,6 +4614,7 @@ const toZigbee2 = {
|
|
|
4521
4614
|
},
|
|
4522
4615
|
moes_thermostat_min_temperature_limit: {
|
|
4523
4616
|
key: ["min_temperature_limit"],
|
|
4617
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
4524
4618
|
convertSet: async (entity, key, value, meta) => {
|
|
4525
4619
|
if (["_TZE200_5toc8efa", "_TZE204_5toc8efa"].includes(meta.device.manufacturerName)) {
|
|
4526
4620
|
await sendDataPointValue(entity, dataPoints.moesMinTempLimit, value * 10);
|
|
@@ -4532,6 +4626,7 @@ const toZigbee2 = {
|
|
|
4532
4626
|
},
|
|
4533
4627
|
moes_thermostat_max_temperature_limit: {
|
|
4534
4628
|
key: ["max_temperature_limit"],
|
|
4629
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
4535
4630
|
convertSet: async (entity, key, value, meta) => {
|
|
4536
4631
|
if (["_TZE200_5toc8efa", "_TZE204_5toc8efa"].includes(meta.device.manufacturerName)) {
|
|
4537
4632
|
await sendDataPointValue(entity, dataPoints.moesMaxTempLimit, value * 10);
|
|
@@ -4585,6 +4680,7 @@ const toZigbee2 = {
|
|
|
4585
4680
|
},
|
|
4586
4681
|
moes_thermostat_program_schedule: {
|
|
4587
4682
|
key: ["program"],
|
|
4683
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
4588
4684
|
convertSet: async (entity, key, value, meta) => {
|
|
4589
4685
|
if (!meta.state.program) {
|
|
4590
4686
|
logger_1.logger.warning("Existing program state not set.", "zhc:legacy:tz:moes_bht_002");
|
|
@@ -4637,19 +4733,23 @@ const toZigbee2 = {
|
|
|
4637
4733
|
await sendDataPointRaw(entity, dataPoints.moesSchedule, payload);
|
|
4638
4734
|
},
|
|
4639
4735
|
},
|
|
4736
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
4640
4737
|
moesS_thermostat_system_mode: {
|
|
4641
4738
|
key: ["system_mode"],
|
|
4642
|
-
convertSet:
|
|
4739
|
+
convertSet: (entity, key, value, meta) => {
|
|
4643
4740
|
return { state: { system_mode: "heat" } };
|
|
4644
4741
|
},
|
|
4645
4742
|
},
|
|
4743
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
4646
4744
|
moesS_thermostat_preset: {
|
|
4647
4745
|
key: ["preset"],
|
|
4746
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
4648
4747
|
convertSet: async (entity, key, value, meta) => {
|
|
4649
4748
|
const lookup = { programming: 0, manual: 1, temporary_manual: 2, holiday: 3 };
|
|
4650
4749
|
await sendDataPointEnum(entity, dataPoints.moesSsystemMode, lookup[value]);
|
|
4651
4750
|
},
|
|
4652
4751
|
},
|
|
4752
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
4653
4753
|
moesS_thermostat_current_heating_setpoint: {
|
|
4654
4754
|
key: ["current_heating_setpoint"],
|
|
4655
4755
|
convertSet: async (entity, key, value, meta) => {
|
|
@@ -4657,30 +4757,35 @@ const toZigbee2 = {
|
|
|
4657
4757
|
await sendDataPointValue(entity, dataPoints.moesSheatingSetpoint, temp);
|
|
4658
4758
|
},
|
|
4659
4759
|
},
|
|
4760
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
4660
4761
|
moesS_thermostat_boost_heating: {
|
|
4661
4762
|
key: ["boost_heating"],
|
|
4662
4763
|
convertSet: async (entity, key, value, meta) => {
|
|
4663
4764
|
await sendDataPointBool(entity, dataPoints.moesSboostHeating, value === "ON");
|
|
4664
4765
|
},
|
|
4665
4766
|
},
|
|
4767
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
4666
4768
|
moesS_thermostat_window_detection: {
|
|
4667
4769
|
key: ["window_detection"],
|
|
4668
4770
|
convertSet: async (entity, key, value, meta) => {
|
|
4669
4771
|
await sendDataPointBool(entity, dataPoints.moesSwindowDetectionFunktion_A2, value === "ON");
|
|
4670
4772
|
},
|
|
4671
4773
|
},
|
|
4774
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
4672
4775
|
moesS_thermostat_child_lock: {
|
|
4673
4776
|
key: ["child_lock"],
|
|
4674
4777
|
convertSet: async (entity, key, value, meta) => {
|
|
4675
4778
|
await sendDataPointBool(entity, dataPoints.moesSchildLock, value === "LOCK");
|
|
4676
4779
|
},
|
|
4677
4780
|
},
|
|
4781
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
4678
4782
|
moesS_thermostat_boostHeatingCountdownTimeSet: {
|
|
4679
4783
|
key: ["boost_heating_countdown_time_set"],
|
|
4680
4784
|
convertSet: async (entity, key, value, meta) => {
|
|
4681
4785
|
await sendDataPointValue(entity, dataPoints.moesSboostHeatingCountdownTimeSet, value);
|
|
4682
4786
|
},
|
|
4683
4787
|
},
|
|
4788
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
4684
4789
|
moesS_thermostat_temperature_calibration: {
|
|
4685
4790
|
key: ["local_temperature_calibration"],
|
|
4686
4791
|
convertSet: async (entity, key, value, meta) => {
|
|
@@ -4691,33 +4796,41 @@ const toZigbee2 = {
|
|
|
4691
4796
|
await sendDataPointValue(entity, dataPoints.moesScompensationTempSet, temp);
|
|
4692
4797
|
},
|
|
4693
4798
|
},
|
|
4799
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
4694
4800
|
moesS_thermostat_moesSecoMode: {
|
|
4695
4801
|
key: ["eco_mode"],
|
|
4696
4802
|
convertSet: async (entity, key, value, meta) => {
|
|
4697
4803
|
await sendDataPointBool(entity, dataPoints.moesSecoMode, value === "ON");
|
|
4698
4804
|
},
|
|
4699
4805
|
},
|
|
4806
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
4700
4807
|
moesS_thermostat_eco_temperature: {
|
|
4701
4808
|
key: ["eco_temperature"],
|
|
4809
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
4702
4810
|
convertSet: async (entity, key, value, meta) => {
|
|
4703
4811
|
const temp = Math.round(value);
|
|
4704
4812
|
await sendDataPointValue(entity, dataPoints.moesSecoModeTempSet, temp);
|
|
4705
4813
|
},
|
|
4706
4814
|
},
|
|
4815
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
4707
4816
|
moesS_thermostat_max_temperature: {
|
|
4708
4817
|
key: ["max_temperature"],
|
|
4818
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
4709
4819
|
convertSet: async (entity, key, value, meta) => {
|
|
4710
4820
|
const temp = Math.round(value);
|
|
4711
4821
|
await sendDataPointValue(entity, dataPoints.moesSmaxTempSet, temp);
|
|
4712
4822
|
},
|
|
4713
4823
|
},
|
|
4824
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
4714
4825
|
moesS_thermostat_min_temperature: {
|
|
4715
4826
|
key: ["min_temperature"],
|
|
4827
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
4716
4828
|
convertSet: async (entity, key, value, meta) => {
|
|
4717
4829
|
const temp = Math.round(value);
|
|
4718
4830
|
await sendDataPointValue(entity, dataPoints.moesSminTempSet, temp);
|
|
4719
4831
|
},
|
|
4720
4832
|
},
|
|
4833
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
4721
4834
|
moesS_thermostat_schedule_programming: {
|
|
4722
4835
|
key: ["programming_mode"],
|
|
4723
4836
|
convertSet: async (entity, key, value, meta) => {
|
|
@@ -4767,11 +4880,14 @@ const toZigbee2 = {
|
|
|
4767
4880
|
},
|
|
4768
4881
|
moes_thermostat_sensor: {
|
|
4769
4882
|
key: ["sensor"],
|
|
4883
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
4770
4884
|
convertSet: async (entity, key, value, meta) => {
|
|
4771
4885
|
if (typeof value === "string") {
|
|
4886
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
4772
4887
|
value = value.toLowerCase();
|
|
4773
4888
|
const lookup = { in: 0, al: 1, ou: 2 };
|
|
4774
4889
|
utils.validateValue(value, Object.keys(lookup));
|
|
4890
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
4775
4891
|
value = lookup[value];
|
|
4776
4892
|
}
|
|
4777
4893
|
if (typeof value === "number" && value >= 0 && value <= 2) {
|
|
@@ -4791,8 +4907,10 @@ const toZigbee2 = {
|
|
|
4791
4907
|
},
|
|
4792
4908
|
tuya_dimmer_level: {
|
|
4793
4909
|
key: ["brightness_min", "min_brightness", "max_brightness", "brightness", "brightness_percent", "level"],
|
|
4910
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
4794
4911
|
convertSet: async (entity, key, value, meta) => {
|
|
4795
4912
|
// upscale to 1000
|
|
4913
|
+
// biome-ignore lint/suspicious/noImplicitAnyLet: ignored using `--suppress`
|
|
4796
4914
|
let newValue;
|
|
4797
4915
|
let dp = dataPoints.dimmerLevel;
|
|
4798
4916
|
if (["_TZE200_3p5ydos3", "_TZE200_9i9dt8is", "_TZE200_dfxkcots", "_TZE200_w4cryh2i"].includes(meta.device.manufacturerName)) {
|
|
@@ -4856,6 +4974,7 @@ const toZigbee2 = {
|
|
|
4856
4974
|
},
|
|
4857
4975
|
tuya_switch_state: {
|
|
4858
4976
|
key: ["state"],
|
|
4977
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
4859
4978
|
convertSet: async (entity, key, value, meta) => {
|
|
4860
4979
|
const lookup = { l1: 1, l2: 2, l3: 3, l4: 4, l5: 5, l6: 6 };
|
|
4861
4980
|
const multiEndpoint = utils.getMetaValue(entity, meta.mapped, "multiEndpoint", "allEqual", false);
|
|
@@ -4883,6 +5002,7 @@ const toZigbee2 = {
|
|
|
4883
5002
|
return { state: { timer: value } };
|
|
4884
5003
|
},
|
|
4885
5004
|
},
|
|
5005
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
4886
5006
|
ZVG1_timer: {
|
|
4887
5007
|
key: ["timer"],
|
|
4888
5008
|
convertSet: async (entity, key, value, meta) => {
|
|
@@ -4893,6 +5013,7 @@ const toZigbee2 = {
|
|
|
4893
5013
|
return { state: { timer: value } };
|
|
4894
5014
|
},
|
|
4895
5015
|
},
|
|
5016
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
4896
5017
|
ZVG1_weather_delay: {
|
|
4897
5018
|
key: ["weather_delay"],
|
|
4898
5019
|
convertSet: async (entity, key, value, meta) => {
|
|
@@ -4900,6 +5021,7 @@ const toZigbee2 = {
|
|
|
4900
5021
|
await sendDataPointEnum(entity, 10, lookup[value]);
|
|
4901
5022
|
},
|
|
4902
5023
|
},
|
|
5024
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
4903
5025
|
ZVG1_cycle_timer: {
|
|
4904
5026
|
key: ["cycle_timer_1", "cycle_timer_2", "cycle_timer_3", "cycle_timer_4"],
|
|
4905
5027
|
convertSet: async (entity, key, value, meta) => {
|
|
@@ -4954,6 +5076,7 @@ const toZigbee2 = {
|
|
|
4954
5076
|
return ret;
|
|
4955
5077
|
},
|
|
4956
5078
|
},
|
|
5079
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
4957
5080
|
ZVG1_normal_schedule_timer: {
|
|
4958
5081
|
key: ["normal_schedule_timer_1", "normal_schedule_timer_2", "normal_schedule_timer_3", "normal_schedule_timer_4"],
|
|
4959
5082
|
convertSet: async (entity, key, value, meta) => {
|
|
@@ -5101,6 +5224,7 @@ const toZigbee2 = {
|
|
|
5101
5224
|
// ]
|
|
5102
5225
|
payload.push(1 << (dayofweek - 1), 4);
|
|
5103
5226
|
}
|
|
5227
|
+
// biome-ignore lint/complexity/noForEach: ignored using `--suppress`
|
|
5104
5228
|
transitions.forEach((transition) => {
|
|
5105
5229
|
payload.push(...transitionToData(transition));
|
|
5106
5230
|
});
|
|
@@ -5315,6 +5439,7 @@ const toZigbee2 = {
|
|
|
5315
5439
|
tuya_thermostat_schedule: {
|
|
5316
5440
|
// payload example {"holidays":[{"hour":6,"minute":0,"temperature":20},{"hour":8,"minute":0,.... 6x
|
|
5317
5441
|
key: ["schedule"],
|
|
5442
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5318
5443
|
convertSet: async (entity, key, value, meta) => {
|
|
5319
5444
|
const prob = Object.keys(value)[0]; // "workdays" or "holidays"
|
|
5320
5445
|
if (prob === "workdays" || prob === "holidays") {
|
|
@@ -5338,6 +5463,7 @@ const toZigbee2 = {
|
|
|
5338
5463
|
tuya_thermostat_schedule_programming_mode: {
|
|
5339
5464
|
// payload example "00:20/5°C 01:20/5°C 6:59/15°C 18:00/5°C 20:00/5°C 23:30/5°C"
|
|
5340
5465
|
key: ["workdays_schedule", "holidays_schedule"],
|
|
5466
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5341
5467
|
convertSet: async (entity, key, value, meta) => {
|
|
5342
5468
|
const dpId = key === "workdays_schedule" ? dataPoints.scheduleWorkday : dataPoints.scheduleHoliday;
|
|
5343
5469
|
const payload = [];
|
|
@@ -5360,6 +5486,7 @@ const toZigbee2 = {
|
|
|
5360
5486
|
},
|
|
5361
5487
|
tuya_thermostat_week: {
|
|
5362
5488
|
key: ["week"],
|
|
5489
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5363
5490
|
convertSet: async (entity, key, value, meta) => {
|
|
5364
5491
|
const lookup = { "5+2": 0, "6+1": 1, "7": 2 };
|
|
5365
5492
|
const week = lookup[value];
|
|
@@ -5369,6 +5496,7 @@ const toZigbee2 = {
|
|
|
5369
5496
|
},
|
|
5370
5497
|
tuya_cover_options: {
|
|
5371
5498
|
key: ["options"],
|
|
5499
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5372
5500
|
convertSet: async (entity, key, value, meta) => {
|
|
5373
5501
|
if (value.reverse_direction !== undefined) {
|
|
5374
5502
|
if (value.reverse_direction) {
|
|
@@ -5432,6 +5560,7 @@ const toZigbee2 = {
|
|
|
5432
5560
|
"temperature_alarm",
|
|
5433
5561
|
"humidity_alarm",
|
|
5434
5562
|
],
|
|
5563
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5435
5564
|
convertSet: async (entity, key, value, meta) => {
|
|
5436
5565
|
switch (key) {
|
|
5437
5566
|
case "alarm":
|
|
@@ -5473,6 +5602,7 @@ const toZigbee2 = {
|
|
|
5473
5602
|
},
|
|
5474
5603
|
neo_alarm: {
|
|
5475
5604
|
key: ["alarm", "melody", "volume", "duration"],
|
|
5605
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5476
5606
|
convertSet: async (entity, key, value, meta) => {
|
|
5477
5607
|
switch (key) {
|
|
5478
5608
|
case "alarm":
|
|
@@ -5506,6 +5636,7 @@ const toZigbee2 = {
|
|
|
5506
5636
|
"humidity_sensitivity",
|
|
5507
5637
|
"humidity_report_interval",
|
|
5508
5638
|
],
|
|
5639
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5509
5640
|
convertSet: async (entity, key, value, meta) => {
|
|
5510
5641
|
switch (key) {
|
|
5511
5642
|
case "temperature_unit_convert":
|
|
@@ -5542,6 +5673,7 @@ const toZigbee2 = {
|
|
|
5542
5673
|
},
|
|
5543
5674
|
saswell_thermostat_current_heating_setpoint: {
|
|
5544
5675
|
key: ["current_heating_setpoint"],
|
|
5676
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5545
5677
|
convertSet: async (entity, key, value, meta) => {
|
|
5546
5678
|
const temp = Math.round(value * 10);
|
|
5547
5679
|
await sendDataPointValue(entity, dataPoints.saswellHeatingSetpoint, temp);
|
|
@@ -5597,7 +5729,9 @@ const toZigbee2 = {
|
|
|
5597
5729
|
},
|
|
5598
5730
|
saswell_thermostat_calibration: {
|
|
5599
5731
|
key: ["local_temperature_calibration"],
|
|
5732
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5600
5733
|
convertSet: async (entity, key, value, meta) => {
|
|
5734
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
5601
5735
|
if (value < 0)
|
|
5602
5736
|
value = 0xffffffff + value + 1;
|
|
5603
5737
|
await sendDataPointValue(entity, dataPoints.saswellTempCalibration, value);
|
|
@@ -5605,6 +5739,7 @@ const toZigbee2 = {
|
|
|
5605
5739
|
},
|
|
5606
5740
|
evanell_thermostat_current_heating_setpoint: {
|
|
5607
5741
|
key: ["current_heating_setpoint"],
|
|
5742
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5608
5743
|
convertSet: async (entity, key, value, meta) => {
|
|
5609
5744
|
const temp = Math.round(value * 10);
|
|
5610
5745
|
await sendDataPointValue(entity, dataPoints.evanellHeatingSetpoint, temp);
|
|
@@ -5634,9 +5769,11 @@ const toZigbee2 = {
|
|
|
5634
5769
|
},
|
|
5635
5770
|
silvercrest_smart_led_string: {
|
|
5636
5771
|
key: ["color", "brightness", "effect"],
|
|
5772
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5637
5773
|
convertSet: async (entity, key, value, meta) => {
|
|
5638
5774
|
if (key === "effect") {
|
|
5639
5775
|
await sendDataPointEnum(entity, dataPoints.silvercrestChangeMode, silvercrestModes.effect);
|
|
5776
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5640
5777
|
let data = [];
|
|
5641
5778
|
const effect = silvercrestEffects[value.effect];
|
|
5642
5779
|
data = data.concat(convertStringToHexArray(effect));
|
|
@@ -5716,6 +5853,7 @@ const toZigbee2 = {
|
|
|
5716
5853
|
}
|
|
5717
5854
|
return "0000";
|
|
5718
5855
|
};
|
|
5856
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5719
5857
|
const fillInHSB = (h, s, b, state) => {
|
|
5720
5858
|
// Define default values. Device expects leading zero in string.
|
|
5721
5859
|
const hsb = {
|
|
@@ -5756,6 +5894,7 @@ const toZigbee2 = {
|
|
|
5756
5894
|
else {
|
|
5757
5895
|
hsb = fillInHSB(value.h || value.hue || null, value.s || value.saturation || null, value.b || value.brightness || null, meta.state);
|
|
5758
5896
|
}
|
|
5897
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5759
5898
|
let data = [];
|
|
5760
5899
|
data = data.concat(convertStringToHexArray(hsb.h));
|
|
5761
5900
|
data = data.concat(convertStringToHexArray(hsb.s));
|
|
@@ -5817,6 +5956,7 @@ const toZigbee2 = {
|
|
|
5817
5956
|
"away_preset_days",
|
|
5818
5957
|
"away_preset_temperature",
|
|
5819
5958
|
],
|
|
5959
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5820
5960
|
convertSet: async (entity, key, value, meta) => {
|
|
5821
5961
|
switch (key) {
|
|
5822
5962
|
case "max_temperature_protection":
|
|
@@ -5838,12 +5978,15 @@ const toZigbee2 = {
|
|
|
5838
5978
|
await sendDataPointValue(entity, dataPoints.hyAwayTemp, value);
|
|
5839
5979
|
break;
|
|
5840
5980
|
case "local_temperature_calibration":
|
|
5981
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
5841
5982
|
value = Math.round(value * 10);
|
|
5983
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
5842
5984
|
if (value < 0)
|
|
5843
5985
|
value = 0xffffffff + value + 1;
|
|
5844
5986
|
await sendDataPointValue(entity, dataPoints.hyTempCalibration, value);
|
|
5845
5987
|
break;
|
|
5846
5988
|
case "hysteresis":
|
|
5989
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
5847
5990
|
value = Math.round(value * 10);
|
|
5848
5991
|
await sendDataPointValue(entity, dataPoints.hyHysteresis, value);
|
|
5849
5992
|
break;
|
|
@@ -5863,6 +6006,7 @@ const toZigbee2 = {
|
|
|
5863
6006
|
await sendDataPointValue(entity, dataPoints.hyMinTemp, value);
|
|
5864
6007
|
break;
|
|
5865
6008
|
case "current_heating_setpoint":
|
|
6009
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
5866
6010
|
value = Math.round(value * 10);
|
|
5867
6011
|
await sendDataPointValue(entity, dataPoints.hyHeatingSetpoint, value);
|
|
5868
6012
|
break;
|
|
@@ -5901,23 +6045,28 @@ const toZigbee2 = {
|
|
|
5901
6045
|
"sensitivity",
|
|
5902
6046
|
"keep_time",
|
|
5903
6047
|
],
|
|
6048
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5904
6049
|
convertSet: async (entity, key, value, meta) => {
|
|
5905
6050
|
switch (key) {
|
|
5906
6051
|
case "reporting_time":
|
|
5907
6052
|
await sendDataPointValue(entity, dataPoints.fantemReportingTime, value, "sendData");
|
|
5908
6053
|
break;
|
|
5909
6054
|
case "temperature_calibration":
|
|
6055
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
5910
6056
|
value = Math.round(value * 10);
|
|
6057
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
5911
6058
|
if (value < 0)
|
|
5912
6059
|
value = 0xffffffff + value + 1;
|
|
5913
6060
|
await sendDataPointValue(entity, dataPoints.fantemTempCalibration, value, "sendData");
|
|
5914
6061
|
break;
|
|
5915
6062
|
case "humidity_calibration":
|
|
6063
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
5916
6064
|
if (value < 0)
|
|
5917
6065
|
value = 0xffffffff + value + 1;
|
|
5918
6066
|
await sendDataPointValue(entity, dataPoints.fantemHumidityCalibration, value, "sendData");
|
|
5919
6067
|
break;
|
|
5920
6068
|
case "illuminance_calibration":
|
|
6069
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
5921
6070
|
if (value < 0)
|
|
5922
6071
|
value = 0xffffffff + value + 1;
|
|
5923
6072
|
await sendDataPointValue(entity, dataPoints.fantemLuxCalibration, value, "sendData");
|
|
@@ -5944,8 +6093,10 @@ const toZigbee2 = {
|
|
|
5944
6093
|
}
|
|
5945
6094
|
},
|
|
5946
6095
|
},
|
|
6096
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
5947
6097
|
ZB006X_settings: {
|
|
5948
6098
|
key: ["switch_type", "load_detection_mode", "control_mode"],
|
|
6099
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5949
6100
|
convertSet: async (entity, key, value, meta) => {
|
|
5950
6101
|
switch (key) {
|
|
5951
6102
|
case "switch_type":
|
|
@@ -5969,6 +6120,7 @@ const toZigbee2 = {
|
|
|
5969
6120
|
},
|
|
5970
6121
|
tuya_motion_sensor: {
|
|
5971
6122
|
key: ["o_sensitivity", "v_sensitivity", "led_status", "vacancy_delay", "light_on_luminance_prefer", "light_off_luminance_prefer", "mode"],
|
|
6123
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
5972
6124
|
convertSet: async (entity, key, value, meta) => {
|
|
5973
6125
|
switch (key) {
|
|
5974
6126
|
case "o_sensitivity":
|
|
@@ -6046,6 +6198,7 @@ const toZigbee2 = {
|
|
|
6046
6198
|
"heating_stop",
|
|
6047
6199
|
"preset",
|
|
6048
6200
|
],
|
|
6201
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
6049
6202
|
convertSet: async (entity, key, value, meta) => {
|
|
6050
6203
|
switch (key) {
|
|
6051
6204
|
case "system_mode":
|
|
@@ -6073,23 +6226,29 @@ const toZigbee2 = {
|
|
|
6073
6226
|
await sendDataPointBool(entity, dataPoints.tvChildLock, value === "LOCK");
|
|
6074
6227
|
break;
|
|
6075
6228
|
case "local_temperature_calibration":
|
|
6229
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
6076
6230
|
value = Math.round(value * 10);
|
|
6231
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
6077
6232
|
value = value < 0 ? 0xffffffff + value + 1 : value;
|
|
6078
6233
|
await sendDataPointValue(entity, dataPoints.tvTempCalibration, value);
|
|
6079
6234
|
break;
|
|
6080
6235
|
case "current_heating_setpoint":
|
|
6236
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
6081
6237
|
value = Math.round(value * 10);
|
|
6082
6238
|
await sendDataPointValue(entity, dataPoints.tvHeatingSetpoint, value);
|
|
6083
6239
|
break;
|
|
6084
6240
|
case "holiday_temperature":
|
|
6241
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
6085
6242
|
value = Math.round(value * 10);
|
|
6086
6243
|
await sendDataPointValue(entity, dataPoints.tvHolidayTemp, value);
|
|
6087
6244
|
break;
|
|
6088
6245
|
case "comfort_temperature":
|
|
6246
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
6089
6247
|
value = Math.round(value * 10);
|
|
6090
6248
|
await sendDataPointValue(entity, dataPoints.tvComfortTemp, value);
|
|
6091
6249
|
break;
|
|
6092
6250
|
case "eco_temperature":
|
|
6251
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
6093
6252
|
value = Math.round(value * 10);
|
|
6094
6253
|
await sendDataPointValue(entity, dataPoints.tvEcoTemp, value);
|
|
6095
6254
|
break;
|
|
@@ -6108,6 +6267,7 @@ const toZigbee2 = {
|
|
|
6108
6267
|
// await sendDataPointEnum(entity, dataPoints.tvBoostMode, (value) ? 0 : 1);
|
|
6109
6268
|
// break;
|
|
6110
6269
|
case "open_window_temperature":
|
|
6270
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
6111
6271
|
value = Math.round(value * 10);
|
|
6112
6272
|
await sendDataPointValue(entity, dataPoints.tvOpenWindowTemp, value);
|
|
6113
6273
|
break;
|
|
@@ -6122,12 +6282,14 @@ const toZigbee2 = {
|
|
|
6122
6282
|
},
|
|
6123
6283
|
tuya_light_wz5: {
|
|
6124
6284
|
key: ["color", "color_temp", "brightness", "white_brightness"],
|
|
6285
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
6125
6286
|
convertSet: async (entity, key, value, meta) => {
|
|
6126
6287
|
if (Array.isArray(meta.mapped))
|
|
6127
6288
|
throw new Error("Not supported for groups");
|
|
6128
6289
|
const separateWhite = meta.mapped.meta?.separateWhite;
|
|
6129
6290
|
if (key === "white_brightness" || (!separateWhite && key === "brightness")) {
|
|
6130
6291
|
// upscale to 1000
|
|
6292
|
+
// biome-ignore lint/suspicious/noImplicitAnyLet: ignored using `--suppress`
|
|
6131
6293
|
let newValue;
|
|
6132
6294
|
if (value >= 0 && value <= 255) {
|
|
6133
6295
|
newValue = utils.mapNumberRange(value, 0, 255, 0, 1000);
|
|
@@ -6153,6 +6315,7 @@ const toZigbee2 = {
|
|
|
6153
6315
|
if (typeof value === "string" && Number.isNaN(value)) {
|
|
6154
6316
|
const presetName = value.toLowerCase();
|
|
6155
6317
|
if (presetName in preset) {
|
|
6318
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
6156
6319
|
value = preset[presetName];
|
|
6157
6320
|
}
|
|
6158
6321
|
else {
|
|
@@ -6160,6 +6323,7 @@ const toZigbee2 = {
|
|
|
6160
6323
|
}
|
|
6161
6324
|
}
|
|
6162
6325
|
else {
|
|
6326
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
6163
6327
|
value = light.clampColorTemp(Number(value), colorTempMin, colorTempMax);
|
|
6164
6328
|
}
|
|
6165
6329
|
const data = utils.mapNumberRange(value, colorTempMax, colorTempMin, 0, 1000);
|
|
@@ -6203,6 +6367,7 @@ const toZigbee2 = {
|
|
|
6203
6367
|
if (h) {
|
|
6204
6368
|
// The device expects 0-359
|
|
6205
6369
|
if (h >= 360) {
|
|
6370
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
6206
6371
|
h = 359;
|
|
6207
6372
|
}
|
|
6208
6373
|
hsb.h = make4sizedString(h.toString(16));
|
|
@@ -6228,6 +6393,7 @@ const toZigbee2 = {
|
|
|
6228
6393
|
return hsb;
|
|
6229
6394
|
};
|
|
6230
6395
|
const hsb = fillInHSB(value.h || value.hue || null, value.s || value.saturation || null, value.b || value.brightness || key === "brightness" ? value : null, meta.state);
|
|
6396
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
6231
6397
|
let data = [];
|
|
6232
6398
|
data = data.concat(convertStringToHexArray(hsb.h));
|
|
6233
6399
|
data = data.concat(convertStringToHexArray(hsb.s));
|
|
@@ -6241,13 +6407,16 @@ const toZigbee2 = {
|
|
|
6241
6407
|
}
|
|
6242
6408
|
},
|
|
6243
6409
|
},
|
|
6410
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
6244
6411
|
ZMAM02_cover: {
|
|
6245
6412
|
key: ["state", "position", "mode", "motor_direction", "border", "motor_working_mode"],
|
|
6246
6413
|
options: [exposes.options.invert_cover()],
|
|
6414
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
6247
6415
|
convertSet: async (entity, key, value, meta) => {
|
|
6248
6416
|
if (key === "position") {
|
|
6249
6417
|
if (value >= 0 && value <= 100) {
|
|
6250
6418
|
const invert = isCoverInverted(meta.device.manufacturerName) ? !meta.options.invert_cover : meta.options.invert_cover;
|
|
6419
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
6251
6420
|
value = invert ? 100 - value : value;
|
|
6252
6421
|
await sendDataPointValue(entity, dataPoints.coverPosition, value);
|
|
6253
6422
|
}
|
|
@@ -6258,6 +6427,7 @@ const toZigbee2 = {
|
|
|
6258
6427
|
else if (key === "state") {
|
|
6259
6428
|
const stateEnums = getCoverStateEnums(meta.device.manufacturerName);
|
|
6260
6429
|
logger_1.logger.debug(`Using state enums for ${meta.device.manufacturerName}: ${JSON.stringify(stateEnums)}`, "zhc:legacy:tz:zmam02");
|
|
6430
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
6261
6431
|
value = value.toLowerCase();
|
|
6262
6432
|
switch (value) {
|
|
6263
6433
|
case "close":
|
|
@@ -6291,6 +6461,7 @@ const toZigbee2 = {
|
|
|
6291
6461
|
},
|
|
6292
6462
|
tuya_smart_human_presense_sensor: {
|
|
6293
6463
|
key: ["radar_sensitivity", "minimum_range", "maximum_range", "detection_delay", "fading_time"],
|
|
6464
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
6294
6465
|
convertSet: async (entity, key, value, meta) => {
|
|
6295
6466
|
switch (key) {
|
|
6296
6467
|
case "radar_sensitivity":
|
|
@@ -6313,6 +6484,7 @@ const toZigbee2 = {
|
|
|
6313
6484
|
}
|
|
6314
6485
|
},
|
|
6315
6486
|
},
|
|
6487
|
+
// biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
|
|
6316
6488
|
ZG204ZL_lms: {
|
|
6317
6489
|
key: ["sensitivity", "keep_time"],
|
|
6318
6490
|
convertSet: async (entity, key, value, meta) => {
|
|
@@ -6345,6 +6517,7 @@ const toZigbee2 = {
|
|
|
6345
6517
|
moes_cover: {
|
|
6346
6518
|
key: ["backlight", "calibration", "motor_reversal", "state", "position"],
|
|
6347
6519
|
options: [exposes.options.invert_cover()],
|
|
6520
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
6348
6521
|
convertSet: async (entity, key, value, meta) => {
|
|
6349
6522
|
switch (key) {
|
|
6350
6523
|
case "position":
|
|
@@ -6393,6 +6566,7 @@ const toZigbee2 = {
|
|
|
6393
6566
|
'temperature_setting',
|
|
6394
6567
|
'leakage_current_setting'*/
|
|
6395
6568
|
],
|
|
6569
|
+
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
|
|
6396
6570
|
convertSet: async (entity, key, value, meta) => {
|
|
6397
6571
|
if (key === "state") {
|
|
6398
6572
|
await sendDataPointBool(entity, dataPoints.state, value === "ON");
|