Skip to content

Commit

Permalink
feat: Add OTA and add more actions for JetHome WS7 (#6546)
Browse files Browse the repository at this point in the history
* Fix JetHome WS7 template. Add OTA support.

* JetHome WS7: Add some bugfix values in converter.
  • Loading branch information
adeepn authored Nov 23, 2023
1 parent 6d5dfe8 commit 6569bad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/devices/jethome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import * as exposes from '../lib/exposes';
import fz from '../converters/fromZigbee';
import * as reporting from '../lib/reporting';
import * as utils from '../lib/utils';
import * as ota from '../lib/ota';

const e = exposes.presets;

const jetHome = {
Expand All @@ -11,7 +13,9 @@ const jetHome = {
cluster: 'genMultistateInput',
type: ['attributeReport', 'readResponse'],
convert: (model, msg, publish, options, meta) => {
const actionLookup = {0: 'release', 1: 'single', 2: 'double', 3: 'triple', 4: 'hold'};
const actionLookup = {0: 'release', 1: 'single', 2: 'double', 3: 'triple', 4: 'hold', 256: 'release', 257: 'single', 258: 'double',
259: 'triple', 260: 'hold', 512: 'release', 513: 'single', 514: 'double', 515: 'triple', 516: 'hold', 1024: 'release',
1025: 'single', 1026: 'double', 1027: 'triple', 1028: 'hold'};
const value = msg.data['presentValue'];
const action = utils.getFromLookup(value, actionLookup);
return {action: utils.postfixWithEndpointName(action, msg, model, meta)};
Expand All @@ -28,6 +32,7 @@ const definitions: Definition[] = [
description: '3-ch battery discrete input module',
fromZigbee: [fz.battery, jetHome.fz.multiStateAction],
toZigbee: [],
ota: ota.zigbeeOTA,
exposes: [
e.battery(), e.battery_voltage(), e.action(
['release_in1', 'single_in1', 'double_in1', 'hold_in1',
Expand Down

0 comments on commit 6569bad

Please sign in to comment.