mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Cleanup nest async method which is not awaiting (#72096)
This commit is contained in:
parent
985bcb23f2
commit
784fbf3291
@ -15,7 +15,7 @@ from homeassistant.components.device_automation.exceptions import (
|
||||
)
|
||||
from homeassistant.components.homeassistant.triggers import event as event_trigger
|
||||
from homeassistant.const import CONF_DEVICE_ID, CONF_DOMAIN, CONF_PLATFORM, CONF_TYPE
|
||||
from homeassistant.core import CALLBACK_TYPE, HomeAssistant
|
||||
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
|
||||
from homeassistant.helpers import device_registry as dr
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
||||
@ -33,7 +33,8 @@ TRIGGER_SCHEMA = DEVICE_TRIGGER_BASE_SCHEMA.extend(
|
||||
)
|
||||
|
||||
|
||||
async def async_get_nest_device_id(hass: HomeAssistant, device_id: str) -> str | None:
|
||||
@callback
|
||||
def async_get_nest_device_id(hass: HomeAssistant, device_id: str) -> str | None:
|
||||
"""Get the nest API device_id from the HomeAssistant device_id."""
|
||||
device_registry = dr.async_get(hass)
|
||||
if device := device_registry.async_get(device_id):
|
||||
@ -67,7 +68,7 @@ async def async_get_triggers(
|
||||
hass: HomeAssistant, device_id: str
|
||||
) -> list[dict[str, Any]]:
|
||||
"""List device triggers for a Nest device."""
|
||||
nest_device_id = await async_get_nest_device_id(hass, device_id)
|
||||
nest_device_id = async_get_nest_device_id(hass, device_id)
|
||||
if not nest_device_id:
|
||||
raise InvalidDeviceAutomationConfig(f"Device not found {device_id}")
|
||||
trigger_types = await async_get_device_trigger_types(hass, nest_device_id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user