Skip to content

Commit fb78f1e

Browse files
Fix deprecated usage of async_forward_entry_setup (#45)
* Call async_forward_entry_setups instead of async_forward_entry_setup to fix deprecated usage * Update python version in lint action
1 parent 59601c2 commit fb78f1e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: "Set up Python"
2020
uses: actions/setup-python@v4.7.0
2121
with:
22-
python-version: "3.10"
22+
python-version: "3.12"
2323
cache: "pip"
2424

2525
- name: "Install requirements"

custom_components/chore_helper/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
from . import const, helpers
2424
from .const import LOGGER
2525

26+
PLATFORMS: list[str] = [const.SENSOR_PLATFORM]
27+
2628
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=30)
2729

2830
months = [m["value"] for m in const.MONTH_OPTIONS]
@@ -231,12 +233,9 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
231233
config_entry.options[const.CONF_FREQUENCY],
232234
)
233235
config_entry.add_update_listener(update_listener)
236+
234237
# Add sensor
235-
hass.async_create_task(
236-
hass.config_entries.async_forward_entry_setup(
237-
config_entry, const.SENSOR_PLATFORM
238-
)
239-
)
238+
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
240239
return True
241240

242241

0 commit comments

Comments
 (0)