Skip to content

Commit

Permalink
fix: Fix some Third Reality devices bugs (#8428)
Browse files Browse the repository at this point in the history
Co-authored-by: jintj <[email protected]>
Co-authored-by: Koen Kanters <[email protected]>
  • Loading branch information
3 people authored Dec 3, 2024
1 parent 9ea3f04 commit 8528633
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/devices/third_reality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@ 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, KeyValue} from '../lib/types';
import {DefinitionWithExtend, Fz} from '../lib/types';

const e = exposes.presets;

const fzLocal = {
thirdreality_acceleration: {
cluster: '65521',
cluster: '3rVirationSpecialcluster',
type: ['attributeReport', 'readResponse'],
convert: (model, msg, publish, options, meta) => {
const payload: KeyValue = {};
if (msg.data['1']) payload.x_axis = msg.data['1'];
if (msg.data['2']) payload.y_axis = msg.data['2'];
if (msg.data['3']) payload.z_axis = msg.data['3'];
if (msg.data['0'] == 0) return;
const payload = {xAxis: msg.data['xAxis'], yAxis: msg.data['yAxis'], zAxis: msg.data['zAxis']};
return payload;
},
} satisfies Fz.Converter,
Expand Down Expand Up @@ -427,9 +425,9 @@ const definitions: DefinitionWithExtend[] = [
manufacturerCode: 0x1233,
attributes: {
coolDownTime: {ID: 0x0004, type: Zcl.DataType.UINT16},
xAxis: {ID: 0x0001, type: Zcl.DataType.UINT16},
yAxis: {ID: 0x0002, type: Zcl.DataType.UINT16},
zAxis: {ID: 0x0003, type: Zcl.DataType.UINT16},
xAxis: {ID: 0x0001, type: Zcl.DataType.INT16},
yAxis: {ID: 0x0002, type: Zcl.DataType.INT16},
zAxis: {ID: 0x0003, type: Zcl.DataType.INT16},
},
commands: {},
commandsResponse: {},
Expand Down

0 comments on commit 8528633

Please sign in to comment.