diff --git a/src/data/logbook.ts b/src/data/logbook.ts index 37fa183b75..6509cc5d06 100644 --- a/src/data/logbook.ts +++ b/src/data/logbook.ts @@ -10,7 +10,7 @@ import { computeStateDomain } from "../common/entity/compute_state_domain"; import { LocalizeFunc } from "../common/translations/localize"; import { HaEntityPickerEntityFilterFunc } from "../components/entity/ha-entity-picker"; import { HomeAssistant } from "../types"; -import { UNAVAILABLE_STATES } from "./entity"; +import { UNAVAILABLE, UNKNOWN } from "./entity"; const LOGBOOK_LOCALIZE_PATH = "ui.components.logbook.messages"; export const CONTINUOUS_DOMAINS = ["counter", "proximity", "sensor", "zone"]; @@ -421,7 +421,11 @@ export const localizeStateMessage = ( return localize(`${LOGBOOK_LOCALIZE_PATH}.turned_off`); } - if (UNAVAILABLE_STATES.includes(state)) { + if (state === UNKNOWN) { + return localize(`${LOGBOOK_LOCALIZE_PATH}.became_unknown`); + } + + if (state === UNAVAILABLE) { return localize(`${LOGBOOK_LOCALIZE_PATH}.became_unavailable`); } diff --git a/src/translations/en.json b/src/translations/en.json index 5833a0c573..f08f659a2d 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -391,6 +391,7 @@ "turned_on": "turned on", "changed_to_state": "changed to {state}", "became_unavailable": "became unavailable", + "became_unknown": "became unknown", "detected_tampering": "detected tampering", "cleared_tampering": "cleared tampering" }