Skip to content

Commit

Permalink
Support open / opening state in LockEntity (#19944)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjohansson-ST authored May 8, 2024
1 parent 9e9cb15 commit 9c57c9f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/common/entity/get_states.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@ export const FIXED_DOMAIN_STATES = {
input_button: [],
lawn_mower: ["error", "paused", "mowing", "docked"],
light: ["on", "off"],
lock: ["jammed", "locked", "locking", "unlocked", "unlocking"],
lock: [
"jammed",
"locked",
"locking",
"unlocked",
"unlocking",
"opening",
"open",
],
media_player: [
"off",
"on",
Expand Down
4 changes: 4 additions & 0 deletions src/data/logbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ export const localizeStateMessage = (
return localize(`${LOGBOOK_LOCALIZE_PATH}.is_locking`);
case "unlocking":
return localize(`${LOGBOOK_LOCALIZE_PATH}.is_unlocking`);
case "opening":
return localize(`${LOGBOOK_LOCALIZE_PATH}.is_opening`);
case "open":
return localize(`${LOGBOOK_LOCALIZE_PATH}.is_opened`);
case "locked":
return localize(`${LOGBOOK_LOCALIZE_PATH}.was_locked`);
case "jammed":
Expand Down
2 changes: 2 additions & 0 deletions src/fake_data/entity_component_icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ export const ENTITY_COMPONENT_ICONS: Record<string, ComponentIcons> = {
locking: "mdi:lock-clock",
unlocked: "mdi:lock-open",
unlocking: "mdi:lock-clock",
opening: "mdi:lock-clock",
open: "mdi:lock-open-variant",
},
},
},
Expand Down
1 change: 1 addition & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@
"was_opened": "was opened",
"was_closed": "was closed",
"is_opening": "is opening",
"is_opened": "is opened",
"is_closing": "is closing",
"was_unlocked": "was unlocked",
"was_locked": "was locked",
Expand Down

0 comments on commit 9c57c9f

Please sign in to comment.