Allow ESPHome to trigger the HA tag scanned event (#40128)
This commit is contained in:
parent
a13c4d4c17
commit
d650bcca3b
2 changed files with 11 additions and 3 deletions
|
@ -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…
Add table
Reference in a new issue