mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Fix unknown event type bug (#17426)
* Fix unknown event type bug * Update src/data/logbook.ts Co-authored-by: Bram Kragten <mail@bramkragten.nl> --------- Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
0ee231ee85
commit
a5cd350d25
@ -346,16 +346,18 @@ export const localizeStateMessage = (
|
||||
break;
|
||||
|
||||
case "event": {
|
||||
const event_type =
|
||||
computeAttributeValueDisplay(
|
||||
hass!.localize,
|
||||
stateObj,
|
||||
hass.locale,
|
||||
hass.config,
|
||||
hass.entities,
|
||||
"event_type"
|
||||
)?.toString() ||
|
||||
localize(`${LOGBOOK_LOCALIZE_PATH}.detected_unknown_event`);
|
||||
const event_type = computeAttributeValueDisplay(
|
||||
hass!.localize,
|
||||
stateObj,
|
||||
hass.locale,
|
||||
hass.config,
|
||||
hass.entities,
|
||||
"event_type"
|
||||
)?.toString();
|
||||
|
||||
if (!event_type) {
|
||||
return localize(`${LOGBOOK_LOCALIZE_PATH}.detected_unknown_event`);
|
||||
}
|
||||
|
||||
return localize(`${LOGBOOK_LOCALIZE_PATH}.detected_event`, {
|
||||
event_type: autoCaseNoun(event_type, hass.language),
|
||||
|
Loading…
x
Reference in New Issue
Block a user