12 lines
472 B
Python
12 lines
472 B
Python
"""Helper functions for proximity."""
|
|
from homeassistant.components.automation import automations_with_entity
|
|
from homeassistant.components.script import scripts_with_entity
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
|
|
def entity_used_in(hass: HomeAssistant, entity_id: str) -> list[str]:
|
|
"""Get list of related automations and scripts."""
|
|
used_in = automations_with_entity(hass, entity_id)
|
|
used_in += scripts_with_entity(hass, entity_id)
|
|
return used_in
|