From d817e92a576fef5440c6cb7edadc640c7687810d Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Wed, 30 Aug 2023 09:52:11 -0400 Subject: [PATCH] Remove node status from zwave_js device info card (#17732) --- src/data/zwave_js.ts | 2 -- .../zwave_js/ha-device-info-zwave_js.ts | 28 ------------------- src/translations/en.json | 8 ------ 3 files changed, 38 deletions(-) diff --git a/src/data/zwave_js.ts b/src/data/zwave_js.ts index bb93308fd0..623516ce59 100644 --- a/src/data/zwave_js.ts +++ b/src/data/zwave_js.ts @@ -404,8 +404,6 @@ export interface RequestedGrant { clientSideAuth: boolean; } -export const nodeStatus = ["unknown", "asleep", "awake", "dead", "alive"]; - export const fetchZwaveNetworkStatus = ( hass: HomeAssistant, device_or_entry_id: { diff --git a/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts b/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts index 06e0cad8dc..64d9d0145b 100644 --- a/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts @@ -1,4 +1,3 @@ -import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, CSSResultGroup, @@ -16,9 +15,7 @@ import { import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; import { fetchZwaveNodeStatus, - nodeStatus, SecurityClass, - subscribeZwaveNodeStatus, ZWaveJSNodeStatus, } from "../../../../../../data/zwave_js"; import { SubscribeMixin } from "../../../../../../mixins/subscribe-mixin"; @@ -44,21 +41,6 @@ export class HaDeviceInfoZWaveJS extends SubscribeMixin(LitElement) { } } - public hassSubscribe(): Array> { - return [ - subscribeZwaveNodeStatus(this.hass, this.device!.id, (message) => { - if (!this._node) { - return; - } - this._node = { - ...this._node, - status: message.status, - ready: message.ready, - }; - }), - ]; - } - protected async _fetchNodeDetails() { if (!this.device) { return; @@ -112,16 +94,6 @@ export class HaDeviceInfoZWaveJS extends SubscribeMixin(LitElement) { ${!this._node.is_controller_node ? html` -
- ${this.hass.localize( - "ui.panel.config.zwave_js.device_info.node_status" - )}: - ${this.hass.localize( - `ui.panel.config.zwave_js.node_status.${ - nodeStatus[this._node.status] - }` - )} -
${this.hass.localize( "ui.panel.config.zwave_js.device_info.node_ready" diff --git a/src/translations/en.json b/src/translations/en.json index 051837943b..f1f5f7f1e8 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -3960,7 +3960,6 @@ "device_info": { "zwave_info": "Z-Wave info", "node_id": "ID", - "node_status": "Status", "node_ready": "Ready", "device_config": "Configure", "reinterview_device": "Re-interview", @@ -4067,13 +4066,6 @@ "parameter": "Parameter", "bitmask": "Bitmask" }, - "node_status": { - "unknown": "Unknown", - "asleep": "Asleep", - "awake": "Awake", - "dead": "Dead", - "alive": "Alive" - }, "network_status": { "connected": "Connected", "connecting": "Connecting",