mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +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;
|
break;
|
||||||
|
|
||||||
case "event": {
|
case "event": {
|
||||||
const event_type =
|
const event_type = computeAttributeValueDisplay(
|
||||||
computeAttributeValueDisplay(
|
|
||||||
hass!.localize,
|
hass!.localize,
|
||||||
stateObj,
|
stateObj,
|
||||||
hass.locale,
|
hass.locale,
|
||||||
hass.config,
|
hass.config,
|
||||||
hass.entities,
|
hass.entities,
|
||||||
"event_type"
|
"event_type"
|
||||||
)?.toString() ||
|
)?.toString();
|
||||||
localize(`${LOGBOOK_LOCALIZE_PATH}.detected_unknown_event`);
|
|
||||||
|
if (!event_type) {
|
||||||
|
return localize(`${LOGBOOK_LOCALIZE_PATH}.detected_unknown_event`);
|
||||||
|
}
|
||||||
|
|
||||||
return localize(`${LOGBOOK_LOCALIZE_PATH}.detected_event`, {
|
return localize(`${LOGBOOK_LOCALIZE_PATH}.detected_event`, {
|
||||||
event_type: autoCaseNoun(event_type, hass.language),
|
event_type: autoCaseNoun(event_type, hass.language),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user