Cleanup hue async methods which are not awaiting (#72097)

pull/70938/head^2
epenet 2022-05-18 18:43:43 +02:00 committed by GitHub
parent 50ca14538a
commit f4b252a51d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -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)

View File

@ -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.

View File

@ -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