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;
status: number;
is_secure: boolean | string;
is_routing: boolean | null;
zwave_plus_version: number | null;
highest_security_class: SecurityClass | null;
}
export interface ZwaveJSNodeMetadata {

View File

@ -18,6 +18,7 @@ import {
nodeStatus,
ZWaveJSNodeStatus,
ZWaveJSNodeIdentifiers,
SecurityClass,
} from "../../../../../../data/zwave_js";
import { haStyle } from "../../../../../../resources/styles";
import { HomeAssistant } from "../../../../../../types";
@ -117,13 +118,33 @@ export class HaDeviceInfoZWaveJS extends LitElement {
: this.hass.localize("ui.common.no")}
</div>
<div>
${this.hass.localize("ui.panel.config.zwave_js.device_info.is_secure")}:
${this._node.is_secure === true
? this.hass.localize("ui.common.yes")
${this.hass.localize(
"ui.panel.config.zwave_js.device_info.highest_security"
)}:
${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.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")}
</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
.label=${html`<b
>${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
>
<div class="secondary">
${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>`}
>

View File

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