Add additional properties to zwave_js device info panel (#10132)

This commit is contained in:
Raman Gupta 2021-10-25 10:13:59 -04:00 committed by GitHub
parent 9bcd26ce57
commit 5c3e0cc016
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 55 additions and 26 deletions

View File

@ -84,6 +84,9 @@ export interface ZWaveJSNodeStatus {
ready: boolean; ready: boolean;
status: number; status: number;
is_secure: boolean | string; is_secure: boolean | string;
is_routing: boolean | null;
zwave_plus_version: number | null;
highest_security_class: SecurityClass | null;
} }
export interface ZwaveJSNodeMetadata { export interface ZwaveJSNodeMetadata {

View File

@ -18,6 +18,7 @@ import {
nodeStatus, nodeStatus,
ZWaveJSNodeStatus, ZWaveJSNodeStatus,
ZWaveJSNodeIdentifiers, ZWaveJSNodeIdentifiers,
SecurityClass,
} from "../../../../../../data/zwave_js"; } from "../../../../../../data/zwave_js";
import { haStyle } from "../../../../../../resources/styles"; import { haStyle } from "../../../../../../resources/styles";
import { HomeAssistant } from "../../../../../../types"; import { HomeAssistant } from "../../../../../../types";
@ -117,13 +118,33 @@ export class HaDeviceInfoZWaveJS extends LitElement {
: this.hass.localize("ui.common.no")} : this.hass.localize("ui.common.no")}
</div> </div>
<div> <div>
${this.hass.localize("ui.panel.config.zwave_js.device_info.is_secure")}: ${this.hass.localize(
${this._node.is_secure === true "ui.panel.config.zwave_js.device_info.highest_security"
? this.hass.localize("ui.common.yes") )}:
${this._node.highest_security_class !== null
? this.hass.localize(
`ui.panel.config.zwave_js.security_classes.${
SecurityClass[this._node.highest_security_class]
}.title`
)
: this._node.is_secure === false : this._node.is_secure === false
? this.hass.localize("ui.common.no") ? this.hass.localize(
"ui.panel.config.zwave_js.security_classes.none.title"
)
: this.hass.localize("ui.panel.config.zwave_js.device_info.unknown")} : this.hass.localize("ui.panel.config.zwave_js.device_info.unknown")}
</div> </div>
<div>
${this.hass.localize(
"ui.panel.config.zwave_js.device_info.zwave_plus"
)}:
${this._node.zwave_plus_version
? this.hass.localize(
"ui.panel.config.zwave_js.device_info.zwave_plus_version",
"version",
this._node.zwave_plus_version
)
: this.hass.localize("ui.common.no")}
</div>
`; `;
} }

View File

@ -202,12 +202,12 @@ class DialogZWaveJSAddNode extends LitElement {
(securityClass) => html`<ha-formfield (securityClass) => html`<ha-formfield
.label=${html`<b .label=${html`<b
>${this.hass.localize( >${this.hass.localize(
`ui.panel.config.zwave_js.add_node.security_classes.${SecurityClass[securityClass]}.title` `ui.panel.config.zwave_js.security_classes.${SecurityClass[securityClass]}.title`
)}</b )}</b
> >
<div class="secondary"> <div class="secondary">
${this.hass.localize( ${this.hass.localize(
`ui.panel.config.zwave_js.add_node.security_classes.${SecurityClass[securityClass]}.description` `ui.panel.config.zwave_js.security_classes.${SecurityClass[securityClass]}.description`
)} )}
</div>`} </div>`}
> >

View File

@ -2831,8 +2831,10 @@
"reinterview_device": "Re-interview Device", "reinterview_device": "Re-interview Device",
"heal_node": "Heal Device", "heal_node": "Heal Device",
"remove_failed": "Remove Failed Device", "remove_failed": "Remove Failed Device",
"is_secure": "Secure", "highest_security": "Highest Security",
"unknown": "Unknown" "unknown": "Unknown",
"zwave_plus": "Z-Wave Plus",
"zwave_plus_version": "Version {version}"
}, },
"node_config": { "node_config": {
"header": "Z-Wave Device Configuration", "header": "Z-Wave Device Configuration",
@ -2868,24 +2870,27 @@
"inclusion_finished": "The device has been added.", "inclusion_finished": "The device has been added.",
"view_device": "View Device", "view_device": "View Device",
"interview_started": "The device is being interviewed. This may take some time.", "interview_started": "The device is being interviewed. This may take some time.",
"interview_failed": "The device interview failed. Additional information may be available in the logs.", "interview_failed": "The device interview failed. Additional information may be available in the logs."
"security_classes": { },
"S2_Unauthenticated": { "security_classes": {
"title": "S2 Unauthenticated", "None": {
"description": "Like S2 Authenticated, but without verification that the correct device is included" "title": "None"
}, },
"S2_Authenticated": { "S2_Unauthenticated": {
"title": "S2 Authenticated", "title": "S2 Unauthenticated",
"description": "Example: Lighting, Sensors and Security Systems" "description": "Like S2 Authenticated, but without verification that the correct device is included"
}, },
"S2_AccessControl": { "S2_Authenticated": {
"title": "S2 Access Control", "title": "S2 Authenticated",
"description": "Example: Door Locks and Garage Doors" "description": "Example: Lighting, Sensors and Security Systems"
}, },
"S0_Legacy": { "S2_AccessControl": {
"title": "S0 Legacy", "title": "S2 Access Control",
"description": "Example: Legacy Door Locks without S2 support" "description": "Example: Door Locks and Garage Doors"
} },
"S0_Legacy": {
"title": "S0 Legacy",
"description": "Example: Legacy Door Locks without S2 support"
} }
}, },
"remove_node": { "remove_node": {