mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-13 20:36:35 +00:00
Ignore progress if no progress (#14024)
This commit is contained in:
parent
05f2ef8a37
commit
08279f35cf
@ -139,6 +139,13 @@ const ENTITIES = [
|
|||||||
title: undefined,
|
title: undefined,
|
||||||
friendly_name: "Installing without title",
|
friendly_name: "Installing without title",
|
||||||
}),
|
}),
|
||||||
|
getEntity("update", "update21", "on", {
|
||||||
|
...base_attributes,
|
||||||
|
in_progress: true,
|
||||||
|
friendly_name: "Update with in_progress true and UPDATE_SUPPORT_PROGRESS",
|
||||||
|
supported_features:
|
||||||
|
base_attributes.supported_features + UPDATE_SUPPORT_PROGRESS,
|
||||||
|
}),
|
||||||
];
|
];
|
||||||
|
|
||||||
@customElement("demo-more-info-update")
|
@customElement("demo-more-info-update")
|
||||||
|
@ -169,7 +169,8 @@ export const computeStateDisplayFromEntityAttributes = (
|
|||||||
// When update is not available and there is no latest_version show "Unavailable"
|
// When update is not available and there is no latest_version show "Unavailable"
|
||||||
return state === "on"
|
return state === "on"
|
||||||
? updateIsInstallingFromAttributes(attributes)
|
? updateIsInstallingFromAttributes(attributes)
|
||||||
? supportsFeatureFromAttributes(attributes, UPDATE_SUPPORT_PROGRESS)
|
? supportsFeatureFromAttributes(attributes, UPDATE_SUPPORT_PROGRESS) &&
|
||||||
|
typeof attributes.in_progress === "number"
|
||||||
? localize("ui.card.update.installing_with_progress", {
|
? localize("ui.card.update.installing_with_progress", {
|
||||||
progress: attributes.in_progress,
|
progress: attributes.in_progress,
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user