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

Allow for different definition model, vendor and description based on whitelabel #5689

Merged
merged 2 commits into from
Apr 23, 2023

Conversation

Koenkk
Copy link
Owner

@Koenkk Koenkk commented Apr 22, 2023

Problem

Currently there is a lot of definition (code) duplication between different TuYa devices.

e.g. the Lidl HG06492B

fingerprint: [{modelID: 'TS0502A', manufacturerName: '_TZ3000_oborybow'}],

is functionally the same as TuYa TS0502A

zigbeeModel: ['TS0502A'],

but with a different vendor/description/model value. This is done in order to generate a separate supported device page (zigbee2mqtt.io) and to show the correct vendor/description/model and picture (since that is based on the model) in the logging/discovery and frontend.

Solution
Override the definition model/vendor/description with the one from the whitelabel. To determine wether a whitelabel matches the device, the fingerprint property of the whitelabel is checked against the device. The fingerprint property is optional. This is because there are a lot of whitelabels already and we don't have all the information to define the missing fingerprints right now.

@Koenkk
Copy link
Owner Author

Koenkk commented Apr 22, 2023

CC: @kirovilya @nurikk @sjorge

@sjorge
Copy link
Contributor

sjorge commented Apr 22, 2023

So if I understand correctly, we can now can add a whiteLabel property to OEM devices and have, then zhc will auto 'clone' the definition but swap out the vendor, model and description for the ones defined so they appear to the user as a 'unique' device?

SGTM

@Koenkk
Copy link
Owner Author

Koenkk commented Apr 22, 2023

@sjorge exactly, but of course only if the whitelabel has a fingerprint. This test case shows how it works https://github.com/Koenkk/zigbee-herdsman-converters/pull/5689/files#diff-af95cb6f5f65fe70216ddce70325e785438d5aaff956a0666ebf46ef6402f526R446 , note that HG06492B has no separate definition and the definition from TS0502A is re-used.

I will also update zigbee2mqtt.io to require a picture for all whitelabels with a fingerprint and generate a separate page for them.

Koenkk added a commit that referenced this pull request May 2, 2023
@sjorge sjorge mentioned this pull request May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants