From 8c4285bbbc760b2caf897c50025aaa6a25f38033 Mon Sep 17 00:00:00 2001 From: NP v/d Spek Date: Fri, 10 May 2024 19:06:49 +0200 Subject: [PATCH 1/5] Modify the way the update shows available updates --- src/data/update.ts | 6 ++---- src/translations/en.json | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/data/update.ts b/src/data/update.ts index f123686799f9..37a00f452e6e 100644 --- a/src/data/update.ts +++ b/src/data/update.ts @@ -158,7 +158,7 @@ export const checkForEntityUpdates = async ( // When updating, and entity does not support % show "Installing" // When updating, and entity does support % show "Installing (xx%)" -// When update available, show the version +// When update available, show "Update available" // When the latest version is skipped, show the latest version // When update is not available, show "Up-to-date" // When update is not available and there is no latest_version show "Unavailable" @@ -192,9 +192,7 @@ export const computeUpdateStateDisplay = ( return hass.localize("ui.card.update.installing"); } - if (attributes.latest_version) { - return attributes.latest_version; - } + return hass.localize("ui.card.update.update_available"); } return hass.formatEntityState(stateObj); diff --git a/src/translations/en.json b/src/translations/en.json index eab739b2f0e1..56f53adf1f58 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -237,6 +237,7 @@ "option": "Option" }, "update": { + "update_available": "Update available", "installing": "Installing", "installing_with_progress": "Installing ({progress}%)", "up_to_date": "Up-to-date" From b8c57176fd90d3344a27ef6e229f104d2cfbf32b Mon Sep 17 00:00:00 2001 From: NP v/d Spek Date: Wed, 22 May 2024 15:19:21 +0200 Subject: [PATCH 2/5] Update src/data/update.ts Co-authored-by: Paul Bottein --- src/data/update.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/update.ts b/src/data/update.ts index 37a00f452e6e..01c6d17b4223 100644 --- a/src/data/update.ts +++ b/src/data/update.ts @@ -192,7 +192,7 @@ export const computeUpdateStateDisplay = ( return hass.localize("ui.card.update.installing"); } - return hass.localize("ui.card.update.update_available"); + return hass.formatEntityState(stateObj); } return hass.formatEntityState(stateObj); From 730ce41668b8bd7d2f2c294637c3da7fc7ca4aed Mon Sep 17 00:00:00 2001 From: NP v/d Spek Date: Wed, 22 May 2024 15:21:55 +0200 Subject: [PATCH 3/5] Update src/data/update.ts --- src/data/update.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/data/update.ts b/src/data/update.ts index 01c6d17b4223..442c3d05c7c7 100644 --- a/src/data/update.ts +++ b/src/data/update.ts @@ -192,7 +192,6 @@ export const computeUpdateStateDisplay = ( return hass.localize("ui.card.update.installing"); } - return hass.formatEntityState(stateObj); } return hass.formatEntityState(stateObj); From 11324558d7ad3580f99ce0eeb39801b6ad4eed43 Mon Sep 17 00:00:00 2001 From: NP v/d Spek Date: Wed, 22 May 2024 15:23:19 +0200 Subject: [PATCH 4/5] Update src/translations/en.json --- src/translations/en.json | 1 - 1 file changed, 1 deletion(-) diff --git a/src/translations/en.json b/src/translations/en.json index 5f1610e9b942..50db6feda5e7 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -237,7 +237,6 @@ "option": "Option" }, "update": { - "update_available": "Update available", "installing": "Installing", "installing_with_progress": "Installing ({progress}%)", "up_to_date": "Up-to-date" From bf88da12ce1821e0480e3eb85d56253e5fd008bd Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Wed, 22 May 2024 15:36:32 +0200 Subject: [PATCH 5/5] Update src/data/update.ts --- src/data/update.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/data/update.ts b/src/data/update.ts index 442c3d05c7c7..13c4b0d028ff 100644 --- a/src/data/update.ts +++ b/src/data/update.ts @@ -191,7 +191,6 @@ export const computeUpdateStateDisplay = ( } return hass.localize("ui.card.update.installing"); } - } return hass.formatEntityState(stateObj);