Skip to content

Commit

Permalink
Expose additional functionality for Fantem ZB006-X (action) (Koenkk#4095
Browse files Browse the repository at this point in the history
)

* Added FantemZB006X config SwType LoadMode CtrlMode

* Added NeoNASPD07 min/max temp, min/max humidity

* Update neo.js

* Update fantem.js

* Update toZigbee.js

* Update fromZigbee.js

* Expose additional functionality for Fantem ZB006-X

* Removed unneeded debug logging (Fantem ZB006-X)

* Trailling space removed

Co-authored-by: Koen Kanters <[email protected]>
  • Loading branch information
AlexKay88 and Koenkk authored Apr 6, 2022
1 parent 3f1e9fe commit b34ec8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 0 additions & 3 deletions converters/toZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -6311,16 +6311,13 @@ const converters = {
convertSet: async (entity, key, value, meta) => {
switch (key) {
case 'ext_switch_type':
meta.logger.debug(`toZigbee.ZB006X_settings: Send key/value [${key}|${value}]`);
await tuya.sendDataPointEnum(entity, 103, {'unknown': 0, 'toggle_sw': 1,
'momentary_sw': 2, 'rotary_sw': 3, 'auto_config': 4}[value]);
break;
case 'load_detection_mode':
meta.logger.debug(`toZigbee.ZB006X_settings: Send key/value [${key}|${value}]`);
await tuya.sendDataPointEnum(entity, 105, {'none': 0, 'first_power_on': 1, 'every_power_on': 2}[value]);
break;
case 'control_mode':
meta.logger.debug(`toZigbee.ZB006X_settings: Send key/value [${key}|${value}]`);
await tuya.sendDataPointEnum(entity, 109, {'local': 0, 'remote': 1, 'both': 2}[value]);
break;
default: // Unknown key
Expand Down
5 changes: 4 additions & 1 deletion devices/fantem.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ module.exports = [
vendor: 'Fantem',
description: 'Smart dimmer module without neutral',
extend: extend.light_onoff_brightness({noConfigure: true}),
fromZigbee: [...extend.light_onoff_brightness({noConfigure: true}).fromZigbee, fz.ZB006X_settings],
fromZigbee: [...extend.light_onoff_brightness({noConfigure: true}).fromZigbee, fz.command_on, fz.command_off,
fz.command_move, fz.command_stop, fz.ZB006X_settings],
toZigbee: [...extend.light_onoff_brightness({noConfigure: true}).toZigbee, tz.ZB006X_settings],
exposes: [e.light_brightness(),
e.action(['on', 'off', 'brightness_move_down', 'brightness_move_up', 'brightness_stop']),
exposes.enum('ext_switch_type', ea.STATE_SET, ['unknown', 'toggle_sw', 'momentary_sw', 'rotary_sw', 'auto_config'])
.withDescription('External switch type'),
exposes.enum('load_detection_mode', ea.STATE_SET, ['none', 'first_power_on', 'every_power_on'])
.withDescription('Load detection mode'),
exposes.enum('control_mode', ea.STATE_SET, ['local', 'remote', 'both']).withDescription('Control mode'),
],
meta: {disableActionGroup: true},
configure: async (device, coordinatorEndpoint, logger) => {
await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
const endpoint = device.getEndpoint(1);
Expand Down

0 comments on commit b34ec8b

Please sign in to comment.