This commit is contained in:
G Johansson
2026-10-05 16:30:03 +00:00
parent 37b42e595d
commit 88980cea29
2 changed files with 11 additions and 3 deletions
+7 -1
View File
@@ -14,10 +14,15 @@ from homeassistant.const import (
SERVICE_RELOAD, # noqa: F401
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv, entity_registry as er
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.group import (
expand_entity_ids as _expand_entity_ids,
)
from homeassistant.helpers.group import (
get_entity_ids as _get_entity_ids,
)
from homeassistant.helpers.group import (
get_group_entities,
)
from homeassistant.helpers.typing import ConfigType
@@ -40,6 +45,7 @@ from .const import ( # noqa: F401
ATTR_ORDER,
ATTR_REMOVE_ENTITIES,
CONF_ALL,
CONF_GROUP_TYPE,
CONF_HIDE_MEMBERS,
CONF_IGNORE_NON_NUMERIC,
DATA_COMPONENT,
+4 -2
View File
@@ -5,6 +5,7 @@ from types import MappingProxyType
from homeassistant.components.group import (
CONF_ENTITIES,
CONF_GROUP_TYPE,
CONF_HIDE_MEMBERS,
CONF_IGNORE_NON_NUMERIC,
DOMAIN as GROUP_DOMAIN,
@@ -30,6 +31,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
config.pop(CONF_ROUND_DIGITS)
config[CONF_HIDE_MEMBERS] = False
config[CONF_IGNORE_NON_NUMERIC] = False
config[CONF_GROUP_TYPE] = SENSOR_DOMAIN
# Create new config entry for group component and remove old entry
new_config_entry = ConfigEntry(
@@ -52,8 +54,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
if old_entity := entity_reg.async_get_entity_id(
SENSOR_DOMAIN, DOMAIN, entry.entry_id
):
entity_reg.async_update_entity(
old_entity, config_entry_id=new_config_entry.entry_id
entity_reg.async_update_entity_platform(
old_entity, GROUP_DOMAIN, new_config_entry_id=new_config_entry.entry_id
)
return True