Take cover "opening" and "closing" into account (#8490)

This commit is contained in:
Philip Allgaier 2021-03-01 12:58:12 +01:00 committed by GitHub
parent 76e0bbb55d
commit f31f10cea9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View File

@ -216,7 +216,6 @@ export const getLogbookMessage = (
case "cold":
case "gas":
case "heat":
case "colightld":
case "moisture":
case "motion":
case "occupancy":
@ -246,9 +245,17 @@ export const getLogbookMessage = (
}
case "cover":
return state === "open"
? hass.localize(`${LOGBOOK_LOCALIZE_PATH}.was_opened`)
: hass.localize(`${LOGBOOK_LOCALIZE_PATH}.was_closed`);
switch (state) {
case "open":
return hass.localize(`${LOGBOOK_LOCALIZE_PATH}.was_opened`);
case "opening":
return hass.localize(`${LOGBOOK_LOCALIZE_PATH}.is_opening`);
case "closing":
return hass.localize(`${LOGBOOK_LOCALIZE_PATH}.is_closing`);
case "closed":
return hass.localize(`${LOGBOOK_LOCALIZE_PATH}.was_closed`);
}
break;
case "lock":
if (state === "unlocked") {

View File

@ -311,6 +311,8 @@
"was_disconnected": "was disconnected",
"was_opened": "was opened",
"was_closed": "was closed",
"is_opening": "is opening",
"is_closing": "is closing",
"was_unlocked": "was unlocked",
"was_locked": "was locked",
"was_plugged_in": "was plugged in",