endpoint.configureReporting should use manufacturerCode from ZCL definition when available #844
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I ran into this when trying to update the Ubisys H1, unless you manually specify the options (the frontend does not), we try to configure it without specifying the manufacturerCode. In this case resulting in a weird INVALID_DATA_TYPE error.
When our ZCL Cluster definition has an attribute manufacturerCode override specified, we should use it.
I worked backwards from what I usually do... which means I probably did it in the correct order 😬
I wrote a test first that configures hvacThermostat.ubisysVacationMode and swap the device in the mock to one with the Ubisys manufacturerCode. And update the manufacturerCode, attributeID and attributeDataType in the expected data to match those of ubisysVacationMode.
That test failed (as expected), after updating endpoint.configureReporting, the new test now passes without manually specifying the manufacturerCode option.
if (attribute.hasOwnProperty('manufacturerCode')) options.manufacturerCode = attribute.manufacturerCode;
doesn't feel very TypeScript to me so there may be a cleaner way to write the same line of code ?This closes #843, I had hoped to be able to add the new features to the H1 before end of year, but since I ran into this it probably going to be for early next year.