Always pass the source of the trigger for logbook context messages (#72333)

This commit is contained in:
J. Nick Koston 2022-05-23 13:35:45 -05:00 committed by GitHub
parent f6370d0522
commit 0248a8710f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 145 additions and 59 deletions

View file

@ -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)