mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Hide hidden updates from sidebar/settings (#21058)
This commit is contained in:
parent
0d489213a4
commit
d36bbfe07d
@ -327,6 +327,7 @@ class HaSidebar extends SubscribeMixin(LitElement) {
|
|||||||
for (const entityId of Object.keys(this.hass.states)) {
|
for (const entityId of Object.keys(this.hass.states)) {
|
||||||
if (
|
if (
|
||||||
entityId.startsWith("update.") &&
|
entityId.startsWith("update.") &&
|
||||||
|
!this.hass.entities[entityId]?.hidden &&
|
||||||
updateCanInstall(this.hass.states[entityId] as UpdateEntity)
|
updateCanInstall(this.hass.states[entityId] as UpdateEntity)
|
||||||
) {
|
) {
|
||||||
updateCount++;
|
updateCount++;
|
||||||
|
@ -6,7 +6,7 @@ import {
|
|||||||
mdiPower,
|
mdiPower,
|
||||||
mdiRefresh,
|
mdiRefresh,
|
||||||
} from "@mdi/js";
|
} from "@mdi/js";
|
||||||
import { HassEntities, UnsubscribeFunc } from "home-assistant-js-websocket";
|
import type { UnsubscribeFunc } from "home-assistant-js-websocket";
|
||||||
import {
|
import {
|
||||||
CSSResultGroup,
|
CSSResultGroup,
|
||||||
LitElement,
|
LitElement,
|
||||||
@ -177,7 +177,10 @@ class HaConfigDashboard extends SubscribeMixin(LitElement) {
|
|||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
const { updates: canInstallUpdates, total: totalUpdates } =
|
const { updates: canInstallUpdates, total: totalUpdates } =
|
||||||
this._filterUpdateEntitiesWithInstall(this.hass.states);
|
this._filterUpdateEntitiesWithInstall(
|
||||||
|
this.hass.states,
|
||||||
|
this.hass.entities
|
||||||
|
);
|
||||||
|
|
||||||
const { issues: repairsIssues, total: totalRepairIssues } =
|
const { issues: repairsIssues, total: totalRepairIssues } =
|
||||||
this._repairsIssues;
|
this._repairsIssues;
|
||||||
@ -306,8 +309,13 @@ class HaConfigDashboard extends SubscribeMixin(LitElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _filterUpdateEntitiesWithInstall = memoizeOne(
|
private _filterUpdateEntitiesWithInstall = memoizeOne(
|
||||||
(entities: HassEntities): { updates: UpdateEntity[]; total: number } => {
|
(
|
||||||
const updates = filterUpdateEntitiesWithInstall(entities);
|
entities: HomeAssistant["states"],
|
||||||
|
entityRegistry: HomeAssistant["entities"]
|
||||||
|
): { updates: UpdateEntity[]; total: number } => {
|
||||||
|
const updates = filterUpdateEntitiesWithInstall(entities).filter(
|
||||||
|
(entity) => !entityRegistry[entity.entity_id]?.hidden
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
updates: updates.slice(0, updates.length === 3 ? updates.length : 2),
|
updates: updates.slice(0, updates.length === 3 ? updates.length : 2),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user