Skip to content

Commit

Permalink
feat: Allow more precise control of Aqara DJT11LM sensitivity Koenkk/…
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Jan 25, 2025
1 parent b79bc94 commit 719f27f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/devices/lumi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2353,7 +2353,7 @@ const definitions: DefinitionWithExtend[] = [
e.vibration(),
e.action(['vibration', 'tilt', 'drop']),
e.numeric('strength', ea.STATE),
e.enum('sensitivity', ea.STATE_SET, ['low', 'medium', 'high']),
e.numeric('sensitivity', ea.STATE_SET).withDescription('Sensitivity, 1 = highest, 21 = lowest').withValueMin(1).withValueMax(21),
e.angle_axis('angle_x'),
e.angle_axis('angle_y'),
e.angle_axis('angle_z'),
Expand Down
10 changes: 5 additions & 5 deletions src/lib/lumi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4691,12 +4691,12 @@ export const toZigbee = {
lumi_vibration_sensitivity: {
key: ['sensitivity'],
convertSet: async (entity, key, value, meta) => {
assertString(value, key);
value = value.toLowerCase();
const lookup = {low: 0x15, medium: 0x0b, high: 0x01};

if (isString(value)) {
value = getFromLookup(value, {low: 0x15, medium: 0x0b, high: 0x01});
}
assertNumber(value);
const options = {...manufacturerOptions.lumi, timeout: 35000};
await entity.write('genBasic', {0xff0d: {value: getFromLookup(value, lookup), type: 0x20}}, options);
await entity.write('genBasic', {0xff0d: {value, type: 0x20}}, options);
return {state: {sensitivity: value}};
},
} satisfies Tz.Converter,
Expand Down

0 comments on commit 719f27f

Please sign in to comment.