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

Change Z-Wave JS API model to match zwave-js #20793

Merged
merged 4 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/data/zwave_js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export interface QRProvisioningInformation {
export interface PlannedProvisioningEntry {
/** The device specific key (DSK) in the form aaaaa-bbbbb-ccccc-ddddd-eeeee-fffff-11111-22222 */
dsk: string;
security_classes: SecurityClass[];
securityClasses: SecurityClass[];
}

export const MINIMUM_QR_STRING_LENGTH = 52;
Expand Down Expand Up @@ -388,11 +388,9 @@ export const enum NodeStatus {
export interface ZwaveJSProvisioningEntry {
/** The device specific key (DSK) in the form aaaaa-bbbbb-ccccc-ddddd-eeeee-fffff-11111-22222 */
dsk: string;
security_classes: SecurityClass[];
additional_properties: {
nodeId?: number;
[prop: string]: any;
};
securityClasses: SecurityClass[];
nodeId?: number;
[prop: string]: any;
raman325 marked this conversation as resolved.
Show resolved Hide resolved
}

export interface RequestedGrant {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ZWaveJSProvisioned extends LitElement {
type: "icon",
width: "100px",
template: (entry) =>
entry.additional_properties.nodeId
entry.nodeId
? html`
<ha-svg-icon
.label=${this.hass.localize(
Expand Down Expand Up @@ -82,7 +82,7 @@ class ZWaveJSProvisioned extends LitElement {
filterable: true,
sortable: true,
template: (entry) => {
const securityClasses = entry.security_classes;
const securityClasses = entry.securityClasses;
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Ensure that the security class names are correctly localized.

The search results indicate that the localization keys for security classes are used in the codebase, but there is no evidence that these keys are defined in the localization files. This suggests that the localization keys might be missing.

  • Files to check for missing localization keys:
    • src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts
    • src/panels/config/integrations/integration-panels/zwave_js/zwave_js-provisioned.ts
    • src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts
Analysis chain

Ensure that the security class names are correctly localized.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify localization keys for security classes.

# Test: Search for the localization keys in the localization files. Expect: Keys should exist.
rg --type yaml 'ui.panel.config.zwave_js.security_classes'

Length of output: 58



Script:

#!/bin/bash
# Description: Verify localization keys for security classes in the entire codebase.

# Test 1: Search for the localization keys in all YAML files. Expect: Keys should exist.
rg --type yaml 'security_classes'

# Test 2: Search for the usage of localization keys in the codebase. Expect: Keys should be used in the code.
rg 'ui.panel.config.zwave_js.security_classes'

Length of output: 1021

return securityClasses
.map((secClass) =>
this.hass.localize(
Expand Down
Loading