Skip to content

Commit

Permalink
feat: Allow to set more sensitivity levels for TuYa TS0210. Koenkk/zi…
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Jun 13, 2023
1 parent 1d4e3cc commit a6ae4fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/converters/toZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -4640,8 +4640,8 @@ const converters = {
TS0210_sensitivity: {
key: ['sensitivity'],
convertSet: async (entity, key, value, meta) => {
const sens = {'high': 0, 'medium': 2, 'low': 6}[value];
await entity.write('ssIasZone', {currentZoneSensitivityLevel: sens});
utils.assertNumber(value, 'sensitivity');
await entity.write('ssIasZone', {currentZoneSensitivityLevel: value});
return {state: {sensitivity: value}};
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3620,7 +3620,7 @@ const definitions: Definition[] = [
description: 'Vibration sensor',
fromZigbee: [fz.battery, fz.ias_vibration_alarm_1_with_timeout],
toZigbee: [tz.TS0210_sensitivity],
exposes: [e.battery(), e.battery_voltage(), e.vibration(), e.enum('sensitivity', ea.STATE_SET, ['low', 'medium', 'high'])],
exposes: [e.battery(), e.battery_voltage(), e.vibration(), e.numeric('sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(50)],
},
{
fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_8bxrzyxz'},
Expand Down

0 comments on commit a6ae4fd

Please sign in to comment.