Add device_id into ESPHome event data (#68408)

This commit is contained in:
Jesse Hills 2022-03-21 01:14:07 +13:00 committed by GitHub
parent 6ffef8373b
commit 994ea04c85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,7 @@ from homeassistant import const
from homeassistant.components import zeroconf from homeassistant.components import zeroconf
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ( from homeassistant.const import (
ATTR_DEVICE_ID,
CONF_HOST, CONF_HOST,
CONF_MODE, CONF_MODE,
CONF_PASSWORD, CONF_PASSWORD,
@ -192,7 +193,13 @@ async def async_setup_entry( # noqa: C901
hass.async_create_task(tag.async_scan_tag(tag_id, device_id)) hass.async_create_task(tag.async_scan_tag(tag_id, device_id))
return return
hass.bus.async_fire(service.service, service_data) hass.bus.async_fire(
service.service,
{
ATTR_DEVICE_ID: device_id,
**service_data,
},
)
else: else:
hass.async_create_task( hass.async_create_task(
hass.services.async_call( hass.services.async_call(