mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 19:56:42 +00:00
Add labels to Person (#2844)
* Added label for Person * Added icon for Person * Changed comment for label * Added translation for person * Updated translation for person
This commit is contained in:
parent
3e28b6f2e2
commit
8c23674683
@ -143,6 +143,7 @@ export class HaStateLabelBadge extends LitElement {
|
||||
case "binary_sensor":
|
||||
case "device_tracker":
|
||||
case "updater":
|
||||
case "person":
|
||||
return stateIcon(state);
|
||||
case "sun":
|
||||
return state.state === "above_horizon"
|
||||
@ -158,11 +159,11 @@ export class HaStateLabelBadge extends LitElement {
|
||||
private _computeLabel(domain, state, _timerTimeRemaining) {
|
||||
if (
|
||||
state.state === "unavailable" ||
|
||||
["device_tracker", "alarm_control_panel"].includes(domain)
|
||||
["device_tracker", "alarm_control_panel", "person"].includes(domain)
|
||||
) {
|
||||
// Localize the state with a special state_badge namespace, which has variations of
|
||||
// the state translations that are truncated to fit within the badge label. Translations
|
||||
// are only added for device_tracker and alarm_control_panel.
|
||||
// are only added for device_tracker, alarm_control_panel and person.
|
||||
return (
|
||||
this.hass!.localize(`state_badge.${domain}.${state.state}`) ||
|
||||
this.hass!.localize(`state_badge.default.${state.state}`) ||
|
||||
|
@ -27,6 +27,7 @@
|
||||
"mailbox": "Mailbox",
|
||||
"media_player": "Media player",
|
||||
"notify": "Notify",
|
||||
"person": "Person",
|
||||
"plant": "Plant",
|
||||
"proximity": "Proximity",
|
||||
"remote": "Remote",
|
||||
@ -244,6 +245,10 @@
|
||||
"idle": "Idle",
|
||||
"standby": "Standby"
|
||||
},
|
||||
"person": {
|
||||
"home": "Home",
|
||||
"not_home": "Away"
|
||||
},
|
||||
"plant": {
|
||||
"ok": "[%key:state::binary_sensor::problem::off%]",
|
||||
"problem": "[%key:state::binary_sensor::problem::on%]"
|
||||
@ -344,6 +349,10 @@
|
||||
"device_tracker": {
|
||||
"home": "[%key:state::device_tracker::home%]",
|
||||
"not_home": "[%key:state::device_tracker::not_home%]"
|
||||
},
|
||||
"person": {
|
||||
"home": "[%key:state::person::home%]",
|
||||
"not_home": "[%key:state::person::not_home%]"
|
||||
}
|
||||
},
|
||||
"ui": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user