Fix Z-WaveJS device count in dashboard (#25635)

This commit is contained in:
Petar Petrov 2025-05-29 15:29:24 +03:00 committed by Bram Kragten
parent 228860a1ee
commit cd61725cf5

View File

@ -133,8 +133,11 @@ class ZWaveJSConfigDashboard extends SubscribeMixin(LitElement) {
if (ERROR_STATES.includes(this._configEntry.state)) { if (ERROR_STATES.includes(this._configEntry.state)) {
return this._renderErrorScreen(); return this._renderErrorScreen();
} }
const provisioningDevices =
this._provisioningEntries?.filter((entry) => !entry.nodeId).length ?? 0;
const notReadyDevices = const notReadyDevices =
this._network?.controller.nodes.filter((node) => !node.ready).length ?? 0; (this._network?.controller.nodes.filter((node) => !node.ready).length ??
0) + provisioningDevices;
return html` return html`
<hass-tabs-subpage <hass-tabs-subpage
@ -182,7 +185,9 @@ class ZWaveJSConfigDashboard extends SubscribeMixin(LitElement) {
${this.hass.localize( ${this.hass.localize(
`ui.panel.config.zwave_js.dashboard.devices`, `ui.panel.config.zwave_js.dashboard.devices`,
{ {
count: this._network.controller.nodes.length, count:
this._network.controller.nodes.length +
provisioningDevices,
} }
)} )}
${notReadyDevices > 0 ${notReadyDevices > 0