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 device to support Trust Remote control ZYCT-202 #300

Merged
merged 8 commits into from
Feb 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -1801,6 +1801,38 @@ const converters = {
return {action: `${direction}`};
},
},
ZYCT202_on: {
cid: 'genOnOff',
type: 'cmdOn',
convert: (model, msg, publish, options) => {
return {action: 'on', action_group: msg.groupid};
},
},
ZYCT202_off: {
cid: 'genOnOff',
type: 'cmdOffWithEffect',
convert: (model, msg, publish, options) => {
return {action: 'off', action_group: msg.groupid};
},
},
ZYCT202_stop: {
cid: 'genLevelCtrl',
type: 'cmdStop',
convert: (model, msg, publish, options) => {
return {action: 'stop', action_group: msg.groupid};
},
},
ZYCT202_up_down: {
cid: 'genLevelCtrl',
type: 'cmdMove',
convert: (model, msg, publish, options) => {
const value = msg.data.data['movemode'];
let action = null;
if (value === 0) action = {'action': 'up-press', 'action_group': msg.groupid};
else if (value === 1) action = {'action': 'down-press', 'action_group': msg.groupid};
return action ? action : null;
},
},
cover_position: {
cid: 'genLevelCtrl',
type: 'devChange',
Expand Down
21 changes: 21 additions & 0 deletions devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -1975,6 +1975,27 @@ const devices = [
},

// Trust
{
zigbeeModel: ['\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000'+
'\u0000\u0000\u0000\u0000\u0000'],
model: 'ZYCT-202',
vendor: 'Trust',
description: 'Remote control',
supports: 'on, off, stop, up-press, down-press',
fromZigbee: [
fz.ZYCT202_on, fz.ZYCT202_off, fz.ZYCT202_stop, fz.ZYCT202_up_down,
],
toZigbee: [],
configure: (ieeeAddr, shepherd, coordinator, callback) => {
const device = shepherd.find(ieeeAddr, 1);
const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0};
const actions = [
(cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb),
];

execute(device, actions, callback);
},
},
{
zigbeeModel: ['ZLL-DimmableLigh'],
model: 'ZLED-2709',
Expand Down