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

tint remote (ZBT-Remote) Color keys #284

Merged
merged 13 commits into from
Feb 19, 2019
29 changes: 25 additions & 4 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
'use strict';

const debounce = require('debounce');
const common = require('./common');
Expand Down Expand Up @@ -1564,22 +1564,43 @@ const converters = {
cid: 'genOnOff',
type: 'cmdOn',
convert: (model, msg, publish, options) => {
return {action: 'toggle'};
return {action: 'power', state: 'on'};
},
},
tint404011_off: {
cid: 'genOnOff',
type: 'cmdOff',
convert: (model, msg, publish, options) => {
return {action: 'toggle'};
return {action: 'power', state: 'off'};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just return action: 'off' here (same for on)

Copy link
Contributor Author

@MoskitoHorst MoskitoHorst Feb 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit: autocorrection can be bad:
There was no reason, we can do it with on and Off.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand, could you explain this further?

},
},
tint404011_brightness_updown_click: {
cid: 'genLevelCtrl',
type: 'cmdStep',
convert: (model, msg, publish, options) => {
const direction = msg.data.data.stepmode === 1 ? 'down' : 'up';
return {action: `brightness_${direction}_click`};
return {action: `brightness_${direction}_click`, stepsize: msg.data.data.stepsize ,transtime: msg.data.data.transtime};
},
},
tint404011_scene: {
cid: 'genBasic',
type: 'cmdWrite',
convert: (model, msg, publish, options) => {
return {action: `scene${msg.data.data[0].attrData}` };
},
},
tint404011_move_to_color_temp: {
cid: 'lightingColorCtrl',
type: 'cmdMoveToColorTemp',
convert: (model, msg, publish, options) => {
return {action: `color_temp`, colortemp: msg.data.data.colortemp, transtime: msg.data.data.transtime };
},
},
tint404011_move_to_color: {
cid: 'lightingColorCtrl',
type: 'cmdMoveToColor',
convert: (model, msg, publish, options) => {
return {action: `color_wheel`, colorx: msg.data.data.colorx, colory: msg.data.data.colory, transtime: msg.data.data.transtime };
},
},
cmdToggle: {
Expand Down
1 change: 1 addition & 0 deletions devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -2401,6 +2401,7 @@ const devices = [
vendor: 'Müller Licht',
fromZigbee: [
fz.tint404011_on, fz.tint404011_off, fz.cmdToggle, fz.tint404011_brightness_updown_click,
fz.tint404011_move_to_color_temp, fz.tint404011_move_to_color, fz.tint404011_scene,
],
toZigbee: [],
},
Expand Down