From 2d651c2a666c595f67db01cc9fe451e6f166a22f Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Tue, 18 Jan 2022 00:53:41 -0500 Subject: [PATCH] Remove action to download state dump from zwave_js (#11348) --- .../zwave_js/zwave_js-config-dashboard.ts | 69 ------------------- src/translations/en.json | 8 +-- 2 files changed, 1 insertion(+), 76 deletions(-) diff --git a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-dashboard.ts b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-dashboard.ts index afd91be9a4..82ef64d6b3 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-dashboard.ts @@ -14,13 +14,11 @@ import "../../../../../components/ha-icon-button"; import "../../../../../components/ha-fab"; import "../../../../../components/ha-icon-next"; import "../../../../../components/ha-svg-icon"; -import { getSignedPath } from "../../../../../data/auth"; import { fetchZwaveDataCollectionStatus, fetchZwaveNetworkStatus, fetchZwaveNodeStatus, fetchZwaveProvisioningEntries, - NodeStatus, setZwaveDataCollectionPreference, ZWaveJSNetwork, ZWaveJSNodeStatus, @@ -31,14 +29,9 @@ import { getConfigEntries, ERROR_STATES, } from "../../../../../data/config_entries"; -import { - showAlertDialog, - showConfirmationDialog, -} from "../../../../../dialogs/generic/show-dialog-box"; import "../../../../../layouts/hass-tabs-subpage"; import { haStyle } from "../../../../../resources/styles"; import type { HomeAssistant, Route } from "../../../../../types"; -import { fileDownload } from "../../../../../util/file_download"; import "../../../ha-config-section"; import { showZWaveJSAddNodeDialog } from "./show-dialog-zwave_js-add-node"; import { showZWaveJSHealNetworkDialog } from "./show-dialog-zwave_js-heal-network"; @@ -212,14 +205,6 @@ class ZWaveJSConfigDashboard extends LitElement { ${this._network.client.ws_server_url}
- - ${this.hass.localize( - "ui.panel.config.zwave_js.dashboard.dump_debug" - )} - !node.ready); - const deadNodes = this._nodes?.filter( - (node) => node.status === NodeStatus.Dead - ); - - if (deadNodes?.length) { - await showAlertDialog(this, { - title: this.hass.localize( - "ui.panel.config.zwave_js.dashboard.dump_dead_nodes_title" - ), - text: this.hass.localize( - "ui.panel.config.zwave_js.dashboard.dump_dead_nodes_text" - ), - }); - } - - if ( - notReadyNodes?.length && - notReadyNodes.length !== deadNodes?.length && - !(await showConfirmationDialog(this, { - title: this.hass.localize( - "ui.panel.config.zwave_js.dashboard.dump_not_ready_title" - ), - text: this.hass.localize( - "ui.panel.config.zwave_js.dashboard.dump_not_ready_text" - ), - confirmText: this.hass.localize( - "ui.panel.config.zwave_js.dashboard.dump_not_ready_confirm" - ), - })) - ) { - return; - } - - let signedPath: { path: string }; - try { - signedPath = await getSignedPath( - this.hass, - `/api/zwave_js/dump/${this.configEntryId}` - ); - } catch (err: any) { - showAlertDialog(this, { - title: "Error", - text: err.error || err.body || err, - }); - return; - } - - fileDownload(this, signedPath.path, `zwave_js_dump.jsonl`); - } - static get styles(): CSSResultGroup { return [ haStyle, diff --git a/src/translations/en.json b/src/translations/en.json index 8f32e732b2..c8097b45d4 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -2896,13 +2896,7 @@ "server_url": "Server URL", "devices": "{count} {count, plural,\n one {device}\n other {devices}\n}", "provisioned_devices": "Provisioned devices", - "not_ready": "{count} not ready", - "dump_debug": "Download data", - "dump_dead_nodes_title": "Some of your devices are dead", - "dump_dead_nodes_text": "Some of your devices didn't respond and are assumed dead. These will not be fully exported.", - "dump_not_ready_title": "Not all devices are ready yet", - "dump_not_ready_text": "If you create an export while not all devices are ready, you could miss needed data. Give your network some time to query all devices. Do you want to continue with the dump?", - "dump_not_ready_confirm": "Download" + "not_ready": "{count} not ready" }, "device_info": { "zwave_info": "Z-Wave Info",