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 GitHub
parent fd13e41524
commit 1485d1a1de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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