Cleanup hue async methods which are not awaiting (#72097)
parent
50ca14538a
commit
f4b252a51d
|
@ -99,5 +99,5 @@ async def async_get_triggers(hass: "HomeAssistant", device_id: str):
|
|||
bridge: HueBridge = hass.data[DOMAIN][conf_entry_id]
|
||||
|
||||
if bridge.api_version == 1:
|
||||
return await async_get_triggers_v1(bridge, device_entry)
|
||||
return await async_get_triggers_v2(bridge, device_entry)
|
||||
return async_get_triggers_v1(bridge, device_entry)
|
||||
return async_get_triggers_v2(bridge, device_entry)
|
||||
|
|
|
@ -16,6 +16,7 @@ from homeassistant.const import (
|
|||
CONF_TYPE,
|
||||
CONF_UNIQUE_ID,
|
||||
)
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.device_registry import DeviceEntry
|
||||
|
||||
from ..const import ATTR_HUE_EVENT, CONF_SUBTYPE, DOMAIN
|
||||
|
@ -160,7 +161,8 @@ async def async_attach_trigger(bridge, device_entry, config, action, automation_
|
|||
)
|
||||
|
||||
|
||||
async def async_get_triggers(bridge: "HueBridge", device: DeviceEntry):
|
||||
@callback
|
||||
def async_get_triggers(bridge: "HueBridge", device: DeviceEntry):
|
||||
"""Return device triggers for device on `v1` bridge.
|
||||
|
||||
Make sure device is a supported remote model.
|
||||
|
|
|
@ -119,7 +119,8 @@ async def async_attach_trigger(
|
|||
)
|
||||
|
||||
|
||||
async def async_get_triggers(bridge: "HueBridge", device_entry: DeviceEntry):
|
||||
@callback
|
||||
def async_get_triggers(bridge: HueBridge, device_entry: DeviceEntry):
|
||||
"""Return device triggers for device on `v2` bridge."""
|
||||
api: HueBridgeV2 = bridge.api
|
||||
|
||||
|
|
Loading…
Reference in New Issue