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

Add support for Lonsonho X702A #5889

Merged
merged 8 commits into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from 6 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
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 23 additions & 1 deletion src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1927,12 +1927,34 @@ const definitions: Definition[] = [
await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
},
},
{
fingerprint: tuya.fingerprint('TS0002', ['_TZ3000_54hjn4vs']),
model: 'TS0002_switch_module_3',
vendor: 'TuYa',
description: '2-Gang switch with backlight',
extend: tuya.extend.switch({powerOnBehavior2: true, indicatorMode: true, endpoints: ['l1', 'l2']}),
endpoint: (device) => {
return {'l1': 1, 'l2': 2};
},
meta: {multiEndpoint: true},
configure: async (device, coordinatorEndpoint, logger) => {
await tuya.configureMagicPacket(device, coordinatorEndpoint, logger);
await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
},
whiteLabel: [
tuya.whitelabel('Lonsonho', 'X702A', '2 Gang switch with backlight', ['_TZ3000_54hjn4vs']),
],
},
{
zigbeeModel: ['TS0002'],
model: 'TS0002',
vendor: 'TuYa',
description: '2 gang switch',
whiteLabel: [{vendor: 'Zemismart', model: 'ZM-CSW002-D_switch'}, {vendor: 'Lonsonho', model: 'X702'},
whiteLabel: [
{vendor: 'Zemismart', model: 'ZM-CSW002-D_switch'},
{vendor: 'Lonsonho', model: 'X702'},
{vendor: 'Lonsonho', model: 'X702A'},
Copy link
Owner

Choose a reason for hiding this comment

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

Why was this added here? X702A = TS0002_switch_module_3, not TS0002, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I remove it from there and create separate zigbeeModel section or just remove?

Copy link
Owner

Choose a reason for hiding this comment

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

Just remove (because it is already under TS0002_switch_module_3)

{vendor: 'Avatto', model: 'ZTS02'}],
extend: tuya.extend.switch(),
exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2')],
Expand Down