Skip to content

Commit

Permalink
Add 33952 (Koenkk#3856)
Browse files Browse the repository at this point in the history
* Added support for 33952

* Added empty to zigbee

* Removed return action = null

* removed 'button' prefix.
  • Loading branch information
9mrcookie9 authored Feb 13, 2022
1 parent 84af9dc commit 5c1ad38
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions devices/awox.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,64 @@
const extend = require('../lib/extend');
const fz = require('../converters/fromZigbee');
const exposes = require('../lib/exposes');
const e = exposes.presets;

const awoxRemoteHelper = {
convertToColorName: (buffer) => {
const commonForColors = buffer[0] === 17 && buffer[2] === 48 && buffer[3] === 0 && buffer[5] === 8 && buffer[6] === 0;

if (commonForColors && buffer[4] === 255) {
return 'red';
} else if (commonForColors && buffer[4] === 42) {
return 'yellow';
} else if (commonForColors && buffer[4] === 85) {
return 'green';
} else if (commonForColors && buffer[4] === 170) {
return 'blue';
}
return null;
},
isRefresh: (buffer) => {
return buffer[0] === 17 && buffer[2] === 16 && buffer[3] === 1 && buffer[4] === 1;
},
};

const fzLocal = {
colors: {
cluster: 'lightingColorCtrl',
type: ['raw'],
convert: (model, msg, publish, options, meta) => {
const color = awoxRemoteHelper.convertToColorName(msg.data);
if (color != null) {
return {
action: color,
};
}
},
},
refreshColored: {
cluster: 'lightingColorCtrl',
type: ['commandMoveHue'],
convert: (model, msg, publish, options, meta) => {
if (msg.data.movemode === 1 && msg.data.rate === 12) {
return {
action: 'refresh_colored',
};
}
},
},
refresh: {
cluster: 'genLevelCtrl',
type: ['raw'],
convert: (model, msg, publish, options, meta) => {
if (awoxRemoteHelper.isRefresh(msg.data)) {
return {
action: 'refresh',
};
}
},
},
};

module.exports = [
{
Expand All @@ -8,6 +68,23 @@ module.exports = [
description: 'LED white',
extend: extend.light_onoff_brightness(),
},
{
fingerprint: [
{type: 'Router', manufacturerName: 'AwoX', modelID: 'TLSR82xx', endpoints: [
{ID: 1, profileID: 260, deviceID: 2028, inputClusters: [0, 3, 4, 4096], outputClusters: [0, 3, 4, 5, 6, 8, 768, 4096]},
{ID: 3, profileID: 4751, deviceID: 2048, inputClusters: [65360, 65361], outputClusters: [65360, 65361]},
]},
],
model: '33952',
vendor: 'AwoX',
description: 'Remote controller',
fromZigbee: [fz.command_on, fzLocal.colors, fzLocal.refresh, fzLocal.refreshColored, fz.command_off,
fz.command_step, fz.command_move, fz.command_stop, fz.command_recall, fz.command_step_color_temperature],
toZigbee: [],
exposes: [e.action(['on', 'off', 'red', 'refresh', 'refresh_colored', 'blue', 'yellow',
'green', 'brightness_step_up', 'brightness_step_down', 'brightness_move_up', 'brightness_move_down', 'brightness_stop',
'recall_1', 'color_temperature_step_up', 'color_temperature_step_down'])],
},
{
fingerprint: [
{type: 'Router', manufacturerName: 'AwoX', modelID: 'TLSR82xx', endpoints: [
Expand Down

0 comments on commit 5c1ad38

Please sign in to comment.