Fix translation of home state (#8015)

This commit is contained in:
quthla 2020-12-29 22:43:41 +01:00 committed by GitHub
parent e477fd567d
commit 5d9e30bbdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,13 +124,17 @@ export const getLogbookMessage = (
switch (domain) { switch (domain) {
case "device_tracker": case "device_tracker":
case "person": case "person":
return state === "not_home" if (state === "not_home") {
? hass.localize(`${LOGBOOK_LOCALIZE_PATH}.was_away`) return hass.localize(`${LOGBOOK_LOCALIZE_PATH}.was_away`);
: hass.localize( }
`${LOGBOOK_LOCALIZE_PATH}.was_at_state`, if (state === "home") {
"state", return hass.localize(`${LOGBOOK_LOCALIZE_PATH}.was_at_home`);
state }
); return hass.localize(
`${LOGBOOK_LOCALIZE_PATH}.was_at_state`,
"state",
state
);
case "sun": case "sun":
return state === "above_horizon" return state === "above_horizon"