-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 zwave expert UI / Installer settings #21897
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes introduce new types and interfaces for managing Z-Wave JS node and endpoint capabilities, enhancing the existing structure. New functions are added for invoking Z-Wave command class APIs and fetching node capabilities. A custom web component for controlling multi-level switches is introduced, along with a component for managing Z-Wave nodes. Additionally, a new configuration entry for the node installer is added, and a translation key for installer settings is included. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
Outside diff range, codebase verification and nitpick comments (1)
src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-installer.ts (1)
23-28
: Ensure Proper Error Handling for Z-Wave JS Data FunctionsThe functions
fetchZwaveNodeMetadata
andfetchZwaveNodeCapabilities
are used without explicit error handling in the components. To prevent unhandled promise rejections and ensure data consistency, consider adding error handling mechanisms such as.catch()
ortry-catch
blocks when using these functions. Additionally, review thehass.callWS
method to understand its error handling capabilities and ensure that any errors are appropriately managed.
- Files to Review:
src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-installer.ts
src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-config.ts
Analysis chain
Check the integration of Z-Wave JS data functions.
The functions
fetchZwaveNodeMetadata
andfetchZwaveNodeCapabilities
are crucial for fetching the necessary data about Z-Wave nodes. It's important to ensure that these functions handle errors appropriately and that their integration into the component's lifecycle is correctly managed to avoid unhandled promises or data inconsistencies.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify error handling in fetchZwaveNodeMetadata and fetchZwaveNodeCapabilities functions. # Test: Search for error handling in the functions. Expect: Proper error handling mechanisms. rg --type typescript -A 5 $'fetchZwaveNodeMetadata|fetchZwaveNodeCapabilities'Length of output: 114
Script:
#!/bin/bash # Corrected command to verify error handling in fetchZwaveNodeMetadata and fetchZwaveNodeCapabilities functions. # Test: Search for error handling in the functions. Expect: Proper error handling mechanisms. rg --type ts -A 5 $'fetchZwaveNodeMetadata|fetchZwaveNodeCapabilities'Length of output: 3718
Script:
#!/bin/bash # Investigate how fetchZwaveNodeMetadata and fetchZwaveNodeCapabilities are used in the components to check for error handling. # Search for usage of fetchZwaveNodeMetadata and fetchZwaveNodeCapabilities in the codebase. rg --type ts -A 10 'fetchZwaveNodeMetadata|fetchZwaveNodeCapabilities'Length of output: 6450
...gration-panels/zwave_js/capability-controls/zwave_js-capability-control-multilevel-switch.ts
Outdated
Show resolved
Hide resolved
...gration-panels/zwave_js/capability-controls/zwave_js-capability-control-multilevel-switch.ts
Outdated
Show resolved
Hide resolved
...gration-panels/zwave_js/capability-controls/zwave_js-capability-control-multilevel-switch.ts
Outdated
Show resolved
Hide resolved
src/panels/config/devices/device-detail/integration-elements/zwave_js/device-actions.ts
Show resolved
Hide resolved
src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-installer.ts
Outdated
Show resolved
Hide resolved
src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-installer.ts
Show resolved
Hide resolved
src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-installer.ts
Show resolved
Hide resolved
Some feedback at a first glance:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may also need a way to display Z-Wave values here that do not translate to an entity. Not sure if this needs a new websocket API or if there is an existing one that can be used. |
Core PR with invoke_cc_api websocket command merged. |
Proposed change
Adds the very basic first steps for an expert UI for zwave
Core PR home-assistant/core#125327
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
Summary by CodeRabbit
New Features
Documentation