[go: up one dir, main page]

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

fix: OTA should use develcoPrimarySwVersion for Develco devices #23129

Merged
merged 3 commits into from
Jun 23, 2024

Conversation

sjorge
Copy link
Sponsor Contributor
@sjorge sjorge commented Jun 22, 2024

@Koenkk as mentioned on discord, we need to read develcoPrimarySwVersion for develco/frient devices instead of swBuildId as that is always returns null otherwise.

I found no clean way to check if we have the develcoPrimarySwVersion on genBasic or not.

I opted to check for the Develco/Frient manufacturerID and just read the right attribute, currently we are hitting the catch branch. If the attributes move from zh -> zhc in the future and a new develco device would be missing the modernExtend we'd still have the same situation a today. I think for now this is fine to do.

@sjorge
Copy link
Sponsor Contributor Author
sjorge commented Jun 22, 2024

Right I somehow need to mock a Develco device for the tests, I'm pretty bad at that stuff.

@sjorge
Copy link
Sponsor Contributor Author
sjorge commented Jun 22, 2024

Ok this isn't working, not sure how to get the test to hit line 141, override the manufacturerCode in the extra tests hit the added if, but I can't get it to hit the resturn at all.

@Koenkk
Copy link
Owner
Koenkk commented Jun 22, 2024

I'm wondering if we can push this down to the definition meta field, something like versionAttributes

@sjorge
Copy link
Sponsor Contributor Author
sjorge commented Jun 22, 2024

Reworked it based on our conversation on Discord. This is not a perfect fix, but it should at least not leave the device with a empty sw version.

Edit: now we have test failures :|

This fix is not perfect, as it will still print that it got updated from null to null.

We just moved the reconfigure later, which will trigger this https://github.com/Koenkk/zigbee-herdsman-converters/blob/000041cba216822dab151151c493b560678da91a/src/devices/develco.ts#L36
for develco/frient devices that have it in their configure. (Which should be all of them)

Of note though, ZCL marks both dateCode and swBuildId as optional attributes, so Develco/Frient returning UNSUPPORTED_ATTRIBUTE here is not outside of spec. Although I'm not sure there is a cleaner way to do this.
@Koenkk Koenkk enabled auto-merge (squash) June 23, 2024 09:23
@Koenkk
Copy link
Owner
Koenkk commented Jun 23, 2024

Fixed the tests, thanks!

@Koenkk Koenkk disabled auto-merge June 23, 2024 09:23
@Koenkk Koenkk merged commit ad84374 into Koenkk:dev Jun 23, 2024
11 checks passed
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.

2 participants