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

Add functionality to Xiaomi MCCGQ13LM #5586

Merged
merged 7 commits into from
Mar 19, 2023
Merged

Add functionality to Xiaomi MCCGQ13LM #5586

merged 7 commits into from
Mar 19, 2023

Conversation

DJTerentjev
Copy link
Contributor

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.
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];
Copy link
Owner

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

Copy link
Contributor Author

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

@@ -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'),
Copy link
Owner

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')

Copy link
Contributor Author

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.

@Koenkk Koenkk merged commit d904ee3 into Koenkk:master Mar 19, 2023
@Koenkk
Copy link
Owner

Koenkk commented Mar 19, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants