Skip to content

Commit

Permalink
feat(add): MC-02 (#5799)
Browse files Browse the repository at this point in the history
* Add Shade Control MC-02 cover

* Update shade_control.js

---------

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
  • Loading branch information
adarazs and Koenkk authored May 26, 2023
1 parent 7d2499b commit 87b196c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/devices/shade_control.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const fz = require('../converters/fromZigbee');
const tz = require('../converters/toZigbee');
const exposes = require('../lib/exposes');
const reporting = require('../lib/reporting');
const e = exposes.presets;

module.exports = [
{
zigbeeModel: ['SC-02'],
model: 'MC-02',
vendor: 'Shade Control',
description: 'Automate shades and blinds with beaded chains',
fromZigbee: [fz.battery, fz.cover_position_tilt],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'closuresWindowCovering']);
await reporting.batteryPercentageRemaining(endpoint);
await reporting.currentPositionLiftPercentage(endpoint);
device.powerSource = 'Battery';
device.save();
},
toZigbee: [tz.cover_state, tz.cover_position_tilt],
exposes: [e.battery(), e.cover_position()],
},
];

0 comments on commit 87b196c

Please sign in to comment.