From 6e3c0e3ed47184800542509227db3d518cf471dc Mon Sep 17 00:00:00 2001 From: support <117250319+3reality-support@users.noreply.github.com> Date: Wed, 11 Dec 2024 03:14:40 +0800 Subject: [PATCH] fix: Update 3r virate xyz axis (#8462) Co-authored-by: jintj Co-authored-by: Koen Kanters --- src/devices/third_reality.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/devices/third_reality.ts b/src/devices/third_reality.ts index 71750e3b2bf74..a8920f99b020b 100644 --- a/src/devices/third_reality.ts +++ b/src/devices/third_reality.ts @@ -5,7 +5,7 @@ import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; import {battery, deviceAddCustomCluster, humidity, iasZoneAlarm, light, onOff, temperature} from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; -import {DefinitionWithExtend, Fz} from '../lib/types'; +import {DefinitionWithExtend, Fz, KeyValue} from '../lib/types'; const e = exposes.presets; @@ -14,8 +14,10 @@ const fzLocal = { cluster: '3rVirationSpecialcluster', type: ['attributeReport', 'readResponse'], convert: (model, msg, publish, options, meta) => { - if (msg.data['0'] == 0) return; - const payload = {x_axis: msg.data['x_axis'], y_axis: msg.data['y_axis'], z_axis: msg.data['z_axis']}; + const payload: KeyValue = {}; + if (msg.data['xAxis']) payload.x_axis = msg.data['xAxis']; + if (msg.data['yAxis']) payload.y_axis = msg.data['yAxis']; + if (msg.data['zAxis']) payload.z_axis = msg.data['zAxis']; return payload; }, } satisfies Fz.Converter,