Always pass the source of the trigger for logbook context messages (#72333)
This commit is contained in:
parent
f6370d0522
commit
0248a8710f
17 changed files with 145 additions and 59 deletions
|
@ -3,6 +3,10 @@ from __future__ import annotations
|
|||
|
||||
from collections.abc import Callable
|
||||
|
||||
from homeassistant.components.logbook.const import (
|
||||
LOGBOOK_ENTRY_MESSAGE,
|
||||
LOGBOOK_ENTRY_NAME,
|
||||
)
|
||||
from homeassistant.const import CONF_DEVICE_ID, CONF_EVENT, CONF_ID, CONF_TYPE
|
||||
from homeassistant.core import Event, HomeAssistant, callback
|
||||
from homeassistant.helpers import device_registry as dr
|
||||
|
@ -66,8 +70,8 @@ def async_describe_events(
|
|||
else:
|
||||
message = f"Event {data[CONF_EVENT]}" # v1
|
||||
return {
|
||||
"name": name,
|
||||
"message": str(message),
|
||||
LOGBOOK_ENTRY_NAME: name,
|
||||
LOGBOOK_ENTRY_MESSAGE: message,
|
||||
}
|
||||
|
||||
async_describe_event(DOMAIN, ATTR_HUE_EVENT, async_describe_hue_event)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue