mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Allow ESPHome to trigger the HA tag scanned event (#40128)
This commit is contained in:
parent
7f8a89838b
commit
d3bb2e5e16
@ -129,6 +129,16 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool
|
||||
"Can only generate events under esphome domain! (%s)", host
|
||||
)
|
||||
return
|
||||
|
||||
# Call native tag scan
|
||||
if service_name == "tag_scanned":
|
||||
tag_id = service_data["tag_id"]
|
||||
device_id = service_data["device_id"]
|
||||
hass.async_create_task(
|
||||
hass.components.tag.async_scan_tag(tag_id, device_id)
|
||||
)
|
||||
return
|
||||
|
||||
hass.bus.async_fire(service.service, service_data)
|
||||
else:
|
||||
hass.async_create_task(
|
||||
|
@ -6,7 +6,5 @@
|
||||
"requirements": ["aioesphomeapi==2.6.3"],
|
||||
"zeroconf": ["_esphomelib._tcp.local."],
|
||||
"codeowners": ["@OttoWinter"],
|
||||
"after_dependencies": [
|
||||
"zeroconf"
|
||||
]
|
||||
"after_dependencies": ["zeroconf", "tag"]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user