Skip to content
7 changes: 3 additions & 4 deletions src/devices/inovelli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2211,17 +2211,16 @@ const fzLocal = {
if (msg.type === "readResponse") {
return Object.keys(msg.data).reduce((p, c) => {
const key = splitValuesByEndpoint ? `${c}_${msg.endpoint.ID}` : c;
const raw = (msg.data as Record<string | number, unknown>)[c];
if (attributes[key] && attributes[key].displayType === "enum") {
return {
// biome-ignore lint/performance/noAccumulatingSpread: ignored using `--suppress`
...p,
[key]: Object.keys(attributes[key].values).find(
(k) => attributes[key].values[k] === msg.data[Number.parseInt(c, 10)],
),
[key]: Object.keys(attributes[key].values).find((k) => attributes[key].values[k] === raw),
};
}
// biome-ignore lint/performance/noAccumulatingSpread: ignored using `--suppress`
return {...p, [key]: msg.data[Number.parseInt(c, 10)]};
return {...p, [key]: raw};
}, {});
}
return msg.data;
Expand Down
Loading