Skip to content

Commit

Permalink
ConfigEntry needs discovery_keys in HA 2024.10 beta (#2533)
Browse files Browse the repository at this point in the history
* chore(deps): update all non-major dependencies

* fix: configEntry needs discovery_keys in HA 2024.10 beta

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
bramstroker and renovate[bot] authored Sep 28, 2024
1 parent 6fa0e40 commit 95fa660
Show file tree
Hide file tree
Showing 4 changed files with 504 additions and 432 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import inspect
import logging

from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry, ConfigFlow
Expand Down Expand Up @@ -71,6 +72,11 @@ async def add_to_associated_group(
if not group_entry and len(group_entry_id) != 32:
group_entry = hass.config_entries.async_entry_for_domain_unique_id(DOMAIN, group_entry_id)
if not group_entry:
additional_args: dict = {}
signature = inspect.signature(ConfigEntry.__init__)
if "discovery_keys" in signature.parameters:
additional_args["discovery_keys"] = {}

group_entry = ConfigEntry(
version=ConfigFlow.VERSION,
minor_version=ConfigFlow.MINOR_VERSION,
Expand All @@ -83,6 +89,7 @@ async def add_to_associated_group(
},
options={},
unique_id=group_entry_id,
**additional_args,
)
await hass.config_entries.async_add(group_entry)

Expand Down
Loading

0 comments on commit 95fa660

Please sign in to comment.