-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Add functionality to Xiaomi MCCGQ13LM #5586
Conversation
Add functionality to Xiaomi MCCGQ13LM (lumi.magnet.ac01). This devise have some kind of anti theft protection - battery cover position.
Add functionality to Xiaomi MCCGQ13LM (lumi.magnet.ac01). This devise have some kind of anti theft protection - battery cover position.
lib/xiaomi.js
Outdated
@@ -502,6 +502,11 @@ const numericAttributes2Payload = async (msg, meta, model, options, dataObject) | |||
payload.buzzer_manual_alarm = value === 1; | |||
} | |||
break; | |||
case '320': | |||
if (['MCCGQ13LM'].includes(model.model)) { | |||
payload.cover = {0: 'Close', 1: 'Open'}[value]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this to battery_cover
and make the values CLOSE
/OPEN
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Renamed to battery_cover and made the values CLOSE/OPEN
devices/xiaomi.js
Outdated
@@ -745,7 +745,9 @@ module.exports = [ | |||
fromZigbee: [fz.xiaomi_contact, fz.ias_contact_alarm_1, fz.aqara_opple], | |||
toZigbee: [], | |||
meta: {battery: {voltageToPercentage: '3V_2850_3000'}}, | |||
exposes: [e.contact(), e.battery(), e.battery_voltage()], | |||
exposes: [e.contact(), e.battery(), e.battery_voltage(), | |||
exposes.enum('battery_cover', ea.STATE, ['CLOSE', 'OPEN']).withDescription('Battery cover position'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for not having noticed this on my first review. But this can become a binary:
exposes.binary('battery_cover', ea.STATE, 'OPEN', 'CLOSE')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Now it's binary.
Thanks! |
Add functionality to Xiaomi MCCGQ13LM (lumi.magnet.ac01). This devise have some kind of anti theft protection - battery cover position.