JurajNyiri / HomeAssistant-Tapo-Control

Control for Tapo cameras as a Home Assistant component
Apache License 2.0
947 stars 80 forks source link

Warning: Detected that 'tapo_control' calls async_forward_entry_setup which is deprecated #616

Open tjorim opened 4 days ago

tjorim commented 4 days ago

Description

Will stop working in Home Assistant 2025.6, await async_forward_entry_setups instead.

Reproduction Steps

Update HA to 2024.7 and check logs

Expected behavior

No warnings about deprecated calls

If applicable, add error logs.

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:184
First occurred: 00:28:27 (25 occurrences)
Last logged: 00:30:47

Detected that custom integration 'tapo_control' calls async_forward_entry_setup for integration, tapo_control with title: 192.168.0.210 and entry_id: e5ca38dd4c59907de1b1e993dce8c967, which is deprecated and will stop working in Home Assistant 2025.6, await async_forward_entry_setups instead at custom_components/tapo_control/__init__.py, line 659: hass.async_create_task(, please create a bug report at https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues
Detected that custom integration 'tapo_control' calls async_forward_entry_setup for integration, tapo_control with title: 192.168.0.210 and entry_id: e5ca38dd4c59907de1b1e993dce8c967, which is deprecated and will stop working in Home Assistant 2025.6, await async_forward_entry_setups instead at custom_components/tapo_control/__init__.py, line 662: hass.async_create_task(, please create a bug report at https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues
Detected that custom integration 'tapo_control' calls async_forward_entry_setup for integration, tapo_control with title: 192.168.0.210 and entry_id: e5ca38dd4c59907de1b1e993dce8c967, which is deprecated and will stop working in Home Assistant 2025.6, await async_forward_entry_setups instead at custom_components/tapo_control/__init__.py, line 665: hass.async_create_task(, please create a bug report at https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues

Device Firmware

n/a

Integration Version

5.4.18

Using stream component

Yes

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

Yes

HASS Environment

Home Assistant OS

Search for similar issues

Yes

Additional information

No response

tjorim commented 4 days ago

And similar warning but will break in HA version 2025.1:

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:151
First occurred: 00:28:51 (7 occurrences)
Last logged: 00:30:33

Detected code that calls async_forward_entry_setup for integration tapo_control with title: 192.168.0.210 and entry_id: e5ca38dd4c59907de1b1e993dce8c967, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
bdraco commented 3 days ago

https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/blob/34e16a155276e1ed16e40ca3f2edab57c739bde4/custom_components/tapo_control/__init__.py#L251

While it won't break, the unloads could be switched to use await hass.config_entries.async_unload_platforms(entry, PLATFORMS) instead as its more efficient