Skip to content

Commit

Permalink
fix: Fixes for MCCGQ13LM, E2007 and TuYa typos (#6666)
Browse files Browse the repository at this point in the history
* Tidy up 2 tuya device vendor names

2 odd devices with a Tuya vendor rather than TuYa

* Tidy up Xiaomi MCCGQ13LM : move battery_cover to tamper

Xiaomi MCCGQ13LM had an odd "battery_cover" expose that alerts on open battery cover
All other devices call that "tamper". Go with the majority.
I don't own the device so cannot test

* Fix double calibration on pm25 STARKVIND Air purifier

While looking at examples of calibration use , stumbled upon this double calibration for pm25
  • Loading branch information
ghoz authored Dec 9, 2023
1 parent 0e9f8d4 commit 5ba0dcd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/devices/ikea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const fzLocal = {
// calibrate and round pm25 unless invalid
pm25 = (pm25 == 65535) ? -1 : calibrateAndPrecisionRoundOptions(pm25, options, 'pm25');

state[pm25Property] = calibrateAndPrecisionRoundOptions(pm25, options, 'pm25');
state[pm25Property] = pm25;
state[airQualityProperty] = airQuality;
}

Expand Down
4 changes: 2 additions & 2 deletions src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -944,9 +944,9 @@ const definitions: Definition[] = [
description: 'Zigbee RGB+CCT light',
whiteLabel: [
tuya.whitelabel('Lidl', '14149505L/14149506L_2', 'Livarno Lux light bar RGB+CCT (black/white)', ['_TZ3210_iystcadi']),
tuya.whitelabel('Tuya', 'TS0505B_1_1', 'Zigbee 3.0 18W led light bulb E27 RGBCW',
tuya.whitelabel('TuYa', 'TS0505B_1_1', 'Zigbee 3.0 18W led light bulb E27 RGBCW',
['_TZ3210_mja6r5ix', '_TZ3210_jd3z4yig', '_TZ3210_r5afgmkl']),
tuya.whitelabel('Tuya', 'TS0505B_1_2', 'Zigbee GU10/E14 5W smart bulb', ['_TZ3210_it1u8ahz']),
tuya.whitelabel('TuYa', 'TS0505B_1_2', 'Zigbee GU10/E14 5W smart bulb', ['_TZ3210_it1u8ahz']),
],
toZigbee: [tz.on_off, tzLocal.led_control],
fromZigbee: [fz.on_off, fz.tuya_led_controller, fz.brightness, fz.ignore_basic_report],
Expand Down
2 changes: 1 addition & 1 deletion src/devices/xiaomi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ const definitions: Definition[] = [
toZigbee: [tzLocal.aqara_detection_distance],
meta: {battery: {voltageToPercentage: '3V_2850_3000'}},
exposes: [e.contact(), e.battery(), e.battery_voltage(),
e.binary('battery_cover', ea.STATE, 'OPEN', 'CLOSE'),
e.tamper(),
e.enum('detection_distance', ea.ALL, ['10mm', '20mm', '30mm'])
.withDescription('The sensor will be considered "off" within the set distance. Please press the device button before setting'),
],
Expand Down
2 changes: 1 addition & 1 deletion src/lib/xiaomi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ export const numericAttributes2Payload = async (msg: Fz.Message, meta: Fz.Meta,
break;
case '320':
if (['MCCGQ13LM'].includes(model.model)) {
payload.battery_cover = getFromLookup(value, {0: 'CLOSE', 1: 'OPEN'});
payload.tamper = getFromLookup(value, {0: false, 1: true});
}
break;
case '322':
Expand Down

0 comments on commit 5ba0dcd

Please sign in to comment.