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

feat: support for Z-Wave JS v13 #3799

Merged
merged 13 commits into from
Jul 18, 2024
Merged

feat: support for Z-Wave JS v13 #3799

merged 13 commits into from
Jul 18, 2024

Conversation

AlCalzone
Copy link
Member

@AlCalzone AlCalzone commented Jul 8, 2024

TODO:

  • Upgrade to an official version of zwave-js-server
  • Wait for the official release of zwave-js
  • Test a bit more
  • Show the reason why adding an association failed in the UI, not only "error while adding"

@coveralls
Copy link

coveralls commented Jul 8, 2024

Pull Request Test Coverage Report for Build 9991427870

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 21.029%

Totals Coverage Status
Change from base Build 9991392406: 0.0%
Covered Lines: 3899
Relevant Lines: 19721

💛 - Coveralls

@@ -1802,7 +1798,8 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
this.logNode(
zwaveNode,
'warn',
`Unable to add Node ${a.nodeId} to Group ${groupId} of ${sourceMsg}, association not allowed`,
// FIXME: We should explain the reason why it failed in human-readable form, see doc comments of AssociationCheckResult
Copy link
Member Author

Choose a reason for hiding this comment

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

still TODO

Copy link
Member

Choose a reason for hiding this comment

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

do you mean on frontend side?

Copy link
Member Author

Choose a reason for hiding this comment

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

Both logs and frontend IMO

Copy link
Member

Choose a reason for hiding this comment

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

Check what i did and let me know if it's ok for you

Copy link
Member Author

Choose a reason for hiding this comment

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

Although, if we do #3801, we don't have to show the error reason in the logs I think, because there shouldn't be one.

Copy link
Member

Choose a reason for hiding this comment

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

there shouldn't doesn't mean there will not, also consider that api can be also called from driver function and MQTT so I would leave it there

Comment on lines 4603 to 4607
const secure = strategy !== InclusionStrategy.Insecure
const message = `${secure ? 'Secure' : 'Non-secure'} inclusion started`
this._updateControllerStatus(message)
// FIXME: Should the frontend also accept the strategy instead of the boolean?
this.emit('event', EventSource.CONTROLLER, 'inclusion started', secure)
Copy link
Member Author

Choose a reason for hiding this comment

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

See FIXME comment

Copy link
Member

Choose a reason for hiding this comment

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

Frontend uses startInclusion and passes the mode:

this.sendAction('startInclusion', [
mode,
{ provisioning },
])

this.sendAction('startInclusion', [
mode,
{
forceSecurity: s.values.forceSecurity,
dsk,
...this.nodeProps,
},
])

Copy link
Member Author

Choose a reason for hiding this comment

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

I meant the event that is emitted below the comment. Right now it gets passed secure, I wonder if it should now include the strategy instead.

Copy link
Member

Choose a reason for hiding this comment

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

that event actually is only emittet to MQTT when Emit events flag is enabled in MQTT settings, nothing used by UI btw. I can fix that and use the inclusion strategy instead

api/lib/ZwaveClient.ts Outdated Show resolved Hide resolved
@@ -1802,7 +1798,8 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
this.logNode(
zwaveNode,
'warn',
`Unable to add Node ${a.nodeId} to Group ${groupId} of ${sourceMsg}, association not allowed`,
// FIXME: We should explain the reason why it failed in human-readable form, see doc comments of AssociationCheckResult
Copy link
Member

Choose a reason for hiding this comment

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

do you mean on frontend side?

Comment on lines 4603 to 4607
const secure = strategy !== InclusionStrategy.Insecure
const message = `${secure ? 'Secure' : 'Non-secure'} inclusion started`
this._updateControllerStatus(message)
// FIXME: Should the frontend also accept the strategy instead of the boolean?
this.emit('event', EventSource.CONTROLLER, 'inclusion started', secure)
Copy link
Member

Choose a reason for hiding this comment

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

Frontend uses startInclusion and passes the mode:

this.sendAction('startInclusion', [
mode,
{ provisioning },
])

this.sendAction('startInclusion', [
mode,
{
forceSecurity: s.values.forceSecurity,
dsk,
...this.nodeProps,
},
])

@robertsLando

This comment was marked as resolved.

@robertsLando robertsLando marked this pull request as ready for review July 18, 2024 12:17
@robertsLando robertsLando merged commit 35f5e7c into master Jul 18, 2024
4 of 8 checks passed
@robertsLando robertsLando deleted the zwave-js-13 branch July 18, 2024 12:24
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