From 8acae63939c0e533eca5722b3d38507a0fbad8ea Mon Sep 17 00:00:00 2001 From: "David F. Mulcahey" Date: Wed, 31 Jan 2024 03:50:55 -0500 Subject: [PATCH] Update ZHA reconfigure device dialog to show accurate cluster configuration statuses (#19527) --- src/data/zha.ts | 2 +- .../zha/dialog-zha-reconfigure-device.ts | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/data/zha.ts b/src/data/zha.ts index 5605384973..be61adbf9e 100644 --- a/src/data/zha.ts +++ b/src/data/zha.ts @@ -73,7 +73,7 @@ export interface ClusterAttributeData { export interface AttributeConfigurationStatus { id: number; name: string; - success: boolean | undefined; + status: string; min: number; max: number; change: number; diff --git a/src/panels/config/integrations/integration-panels/zha/dialog-zha-reconfigure-device.ts b/src/panels/config/integrations/integration-panels/zha/dialog-zha-reconfigure-device.ts index fcc3feb71e..bc5e3a1ef6 100644 --- a/src/panels/config/integrations/integration-panels/zha/dialog-zha-reconfigure-device.ts +++ b/src/panels/config/integrations/integration-panels/zha/dialog-zha-reconfigure-device.ts @@ -1,4 +1,5 @@ import "@material/mwc-button/mwc-button"; +import "@lrnwebcomponents/simple-tooltip/simple-tooltip"; import { mdiCheckCircle, mdiCloseCircle } from "@mdi/js"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, CSSResultGroup, html, LitElement, nothing } from "lit"; @@ -56,6 +57,7 @@ class DialogZHAReconfigureDevice extends LitElement { this._stages = undefined; this._clusterConfigurationStatuses = undefined; this._showDetails = false; + this._allSuccessful = true; fireEvent(this, "dialog-closed", { dialog: this.localName }); } @@ -278,7 +280,7 @@ class DialogZHAReconfigureDevice extends LitElement { (attribute) => html` ${attribute.name}: - ${attribute.success + ${attribute.status === "SUCCESS" ? html` + + ${attribute.status} + { const attribute = attributes[name]; clusterConfigurationStatus!.attributes.set(attribute.id, attribute); - this._allSuccessful = this._allSuccessful && attribute.success; + this._allSuccessful = + this._allSuccessful && + !( + attribute.status in + ["FAILURE", "UNSUPPORTED_ATTRIBUTE", "UNREPORTABLE_ATTRIBUTE"] + ); }); } this.requestUpdate();