Skip to content

Commit

Permalink
feat: Support more features for WETEN PCI E (#7519)
Browse files Browse the repository at this point in the history
* Added motor_direction, remote_pair and motor_working_mode for ZM25R1

* Added datapoint remote_pair and motor_working_mode

* fix line length

* fix line spaces

* Support more features for WETEN Remote Control for PC

* Added datapoints restart_mode and rf_remote_control

* fix line space
  • Loading branch information
Urusus2 committed May 15, 2024
1 parent 3cba0e9 commit 4625587
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/devices/weten.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,30 @@ const definitions: Definition[] = [
fingerprint: tuya.fingerprint('TS0601', ['_TZE204_6fk3gewc']),
model: 'PCI E',
vendor: 'WETEN',
description: 'PC switch',
description: 'Remote Control PCI E Card for PC',
whiteLabel: [{vendor: 'Weten', model: 'Tuya PRO'}],

fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
exposes: [
e.binary('state', ea.STATE_SET, 'ON', 'OFF').withDescription('PC Power'),
e.binary('buzzer_feedback', ea.STATE_SET, 'ON', 'OFF')
.withDescription('Enable buzzer feedback. It sounds on device actions like power state changes, child lock activation, etc.'),
e.child_lock(),
e.binary('rf_pairing', ea.STATE_SET, 'ON', 'OFF').withDescription('Enables/disables RF 433 remote pairing mode'),
e.switch().setAccess('state', ea.STATE_SET),
e.enum('restart_mode', ea.STATE_SET, ['restart', 'force restart', '–']).withDescription('Restart Mode'),
e.binary('rf_pairing', ea.STATE_SET, 'ON', 'OFF').withDescription('Enables/disables RF 433 remote pairing mode').withCategory('config'),
e.binary('rf_remote_control', ea.STATE_SET, 'ON', 'OFF').withDescription('Enables/disables RF 433 remote control').withCategory('config'),
e.binary('buzzer_feedback', ea.STATE_SET, 'ON', 'OFF').withDescription('Enable buzzer feedback.').withCategory('config'),
e.enum('power_on_behavior', ea.STATE_SET, ['on', 'off']).withDescription('Power On Behavior').withCategory('config'),
e.binary('child_lock', ea.STATE_SET, 'LOCK', 'UNLOCK').withDescription('Enables/disables physical input on the device')
.withCategory('config'),
],
meta: {
tuyaDatapoints: [
[1, 'state', tuya.valueConverter.onOff],
[101, 'restart_mode', tuya.valueConverterBasic.lookup({'restart': tuya.enum(0), 'force restart': tuya.enum(1), '–': tuya.enum(2)})],
[102, 'rf_remote_control', tuya.valueConverterBasic.lookup({'ON': tuya.enum(0), 'OFF': tuya.enum(1)})],
[103, 'rf_pairing', tuya.valueConverter.onOff],
[104, 'buzzer_feedback', tuya.valueConverter.onOff],
[105, 'power_on_behavior', tuya.valueConverterBasic.lookup({'off': tuya.enum(0), 'on': tuya.enum(1)})],
[106, 'child_lock', tuya.valueConverter.lockUnlock],
[103, 'rf_pairing', tuya.valueConverter.onOff],
],
},
},
Expand Down
1 change: 1 addition & 0 deletions src/lib/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,7 @@ const tuyaTz = {
'buzzer_feedback', 'rf_pairing', 'max_temperature_alarm', 'min_temperature_alarm', 'max_humidity_alarm', 'min_humidity_alarm',
'temperature_periodic_report', 'humidity_periodic_report', 'temperature_sensitivity', 'humidity_sensitivity', 'temperature_alarm',
'humidity_alarm', 'move_sensitivity', 'radar_range', 'presence_timeout', 'update_frequency', 'remote_pair', 'motor_working_mode',
'restart_mode', 'rf_remote_control',
],
convertSet: async (entity, key, value, meta) => {
// A set converter is only called once; therefore we need to loop
Expand Down

0 comments on commit 4625587

Please sign in to comment.