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

Update tuya.ts #8322

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12895,6 +12895,35 @@ const definitions: DefinitionWithExtend[] = [
],
},
},
{
fingerprint: tuya.fingerprint('TS0601', ['_TZE200_fvldku9h']),
model: 'TS0601',
vendor: 'Tuya',
description: 'Fan switch',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
onEvent: tuya.onEventSetTime,
configure: tuya.configureMagicPacket,
whiteLabel: [{vendor: 'Somgoms', model: 'ZB-1SRW-US'},
tuya.whitelabel('Somgoms', 'ZB-1SRW-US', 'Fan switch', ['_TZE200_fvldku9h']),
],
exposes: [
e.binary('backlight_switch', ea.STATE_SET, 'ON', 'OFF').withDescription('Backlight switch'),
Copy link
Owner

Choose a reason for hiding this comment

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

It's better to have e.fan() for this, you need to add the changes from https://github.com/Koenkk/zigbee-herdsman-converters/pull/8188/files for speed support

e.binary('switch_fan', ea.STATE_SET, 'ON', 'OFF').withDescription('Fan On Off'),
e.numeric('fan_speed', ea.STATE_SET).withValueMin(0).withValueMax(100).withValueStep(1).withUnit('%').withDescription('Fan Speed'),
e.enum('relay_status', ea.STATE_SET, ['off', 'on', 'memory']).withDescription('Recover state after power outage'),
e.numeric('countdown_fan', ea.STATE_SET).withValueMin(0).withValueMax(43200).withValueStep(1).withUnit('s').withDescription('Max ON time in seconds'),
],
meta: {
tuyaDatapoints: [
[1, 'switch_fan', tuya.valueConverter.onOff],
[2, 'countdown_fan', tuya.valueConverter.countdown],
[4, 'fan_speed', tuya.valueConverter.raw],
[11, 'relay_status', tuya.valueConverter.raw],
[13, 'backlight_switch', tuya.valueConverter.onOff],
],
},
},
];

export default definitions;
Expand Down
Loading