From bf35ee549dff6a5aec1a93645955ea0c42b3ea1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Thu, 31 Mar 2022 15:15:21 +0200 Subject: [PATCH] Only use the state to mark updates as pending (#12171) --- src/data/update.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data/update.ts b/src/data/update.ts index 7482412343..9f913111fe 100644 --- a/src/data/update.ts +++ b/src/data/update.ts @@ -2,6 +2,7 @@ import type { HassEntityAttributeBase, HassEntityBase, } from "home-assistant-js-websocket"; +import { BINARY_STATE_ON } from "../common/const"; import { supportsFeature } from "../common/entity/supports-feature"; import { HomeAssistant } from "../types"; @@ -30,9 +31,8 @@ export const updateUsesProgress = (entity: UpdateEntity): boolean => typeof entity.attributes.in_progress === "number"; export const updateCanInstall = (entity: UpdateEntity): boolean => - supportsFeature(entity, UPDATE_SUPPORT_INSTALL) && - entity.attributes.latest_version !== entity.attributes.current_version && - entity.attributes.latest_version !== entity.attributes.skipped_version; + entity.state === BINARY_STATE_ON && + supportsFeature(entity, UPDATE_SUPPORT_INSTALL); export const updateIsInstalling = (entity: UpdateEntity): boolean => updateUsesProgress(entity) || !!entity.attributes.in_progress;