mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Cleanup hue async methods which are not awaiting (#72097)
This commit is contained in:
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]
|
bridge: HueBridge = hass.data[DOMAIN][conf_entry_id]
|
||||||
|
|
||||||
if bridge.api_version == 1:
|
if bridge.api_version == 1:
|
||||||
return await async_get_triggers_v1(bridge, device_entry)
|
return async_get_triggers_v1(bridge, device_entry)
|
||||||
return await async_get_triggers_v2(bridge, device_entry)
|
return async_get_triggers_v2(bridge, device_entry)
|
||||||
|
@ -16,6 +16,7 @@ from homeassistant.const import (
|
|||||||
CONF_TYPE,
|
CONF_TYPE,
|
||||||
CONF_UNIQUE_ID,
|
CONF_UNIQUE_ID,
|
||||||
)
|
)
|
||||||
|
from homeassistant.core import callback
|
||||||
from homeassistant.helpers.device_registry import DeviceEntry
|
from homeassistant.helpers.device_registry import DeviceEntry
|
||||||
|
|
||||||
from ..const import ATTR_HUE_EVENT, CONF_SUBTYPE, DOMAIN
|
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.
|
"""Return device triggers for device on `v1` bridge.
|
||||||
|
|
||||||
Make sure device is a supported remote model.
|
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."""
|
"""Return device triggers for device on `v2` bridge."""
|
||||||
api: HueBridgeV2 = bridge.api
|
api: HueBridgeV2 = bridge.api
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user