Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update 3r virate xyz axis #8462

Merged
merged 25 commits into from
Dec 10, 2024
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/devices/third_reality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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,
Expand Down
Loading