Skip to content

Commit bfbac1e

Browse files
Merge pull request #41 from geoffreylagaisse/main
Fix deprecation warning for async_forward_entry_setup
2 parents fb73f5e + 79a0392 commit bfbac1e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

custom_components/cryptostate/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
SCAN_INTERVAL = timedelta(hours=3)
1515

1616
_LOGGER: logging.Logger = logging.getLogger(__package__)
17-
17+
PLATFORMS = ["sensor"]
1818

1919
async def async_setup(hass: HomeAssistant, config: Config):
2020
"""Set this integration using YAML is not supported."""
@@ -43,9 +43,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
4343

4444
if entry.options.get("sensor", True):
4545
coordinator.platforms.append("sensor")
46-
hass.async_add_job(
47-
hass.config_entries.async_forward_entry_setup(entry, "sensor")
48-
)
46+
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
4947

5048
entry.async_on_unload(entry.add_update_listener(async_reload_entry))
5149
return True

0 commit comments

Comments
 (0)