dlarrick / hass-kumo

Home Assistant module interfacing with Mitsubishi mini-split units
MIT License
99 stars 23 forks source link

add await to async_forward_entry_setup #156

Closed bmos closed 4 months ago

bmos commented 4 months ago

working on a fix for https://github.com/dlarrick/hass-kumo/issues/152

I haven't tested this yet.

bmos commented 4 months ago

This is based on what I see in source code of other integrations: https://github.com/gody01/ecovent_v2/blob/da9919699538d3dd7c41c58a1d630480b1f94bf1/README.md?plain=1#L106-L108

https://github.com/toreamun/amshan-homeassistant/blob/7e1d8657cea15093a6b7a2d953aff875d9925381/custom_components/amshan/__init__.py#L136

I'm unclear whether both calls need await, as here it's just on the create_task call:

https://github.com/loso2255/HA_idrac7_redfish/blob/345dc78059a58a836ca77f3b599e3d065c6732dc/__init__.py#L70-L74

dlarrick commented 4 months ago

Thanks. I should be able to take a look this coming weekend.

dlarrick commented 4 months ago

Hmmm... components that ship with HA seem to use a different pattern, just:

await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)

.... not even looping over the platforms. Just picking one at random: https://github.com/home-assistant/core/blob/dev/homeassistant/components/aemet/__init__.py#L54

dlarrick commented 4 months ago

Yeah... note the new call is _setups (plural). This works and gets rid of the deprecation warning. Thanks for this PR, but I'm going to close it and include the above fix in my own PR.