mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +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
|
"Can only generate events under esphome domain! (%s)", host
|
||||||
)
|
)
|
||||||
return
|
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)
|
hass.bus.async_fire(service.service, service_data)
|
||||||
else:
|
else:
|
||||||
hass.async_create_task(
|
hass.async_create_task(
|
||||||
|
@ -6,7 +6,5 @@
|
|||||||
"requirements": ["aioesphomeapi==2.6.3"],
|
"requirements": ["aioesphomeapi==2.6.3"],
|
||||||
"zeroconf": ["_esphomelib._tcp.local."],
|
"zeroconf": ["_esphomelib._tcp.local."],
|
||||||
"codeowners": ["@OttoWinter"],
|
"codeowners": ["@OttoWinter"],
|
||||||
"after_dependencies": [
|
"after_dependencies": ["zeroconf", "tag"]
|
||||||
"zeroconf"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user