Skip to content

Commit

Permalink
fallback for old configs
Browse files Browse the repository at this point in the history
  • Loading branch information
envy committed Feb 9, 2024
1 parent 2955762 commit 6d1f30c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions knxsync/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Any

from .const import KNXSyncEntityBaseData, DOMAIN, CONF_KNXSYNC_BASE_ANSWER_READS
from .helpers import parse_group_addresses

from homeassistant.config_entries import ConfigEntry
from homeassistant.core import Event, HomeAssistant
Expand Down Expand Up @@ -57,6 +58,11 @@ def _set_value_from_config(self, config_key: str, default: Any) -> None:

async def _register_receiver(self, attr: str) -> None:
v = getattr(self, attr)

if type(v) is str:
# Old style config, convert to list
v = parse_group_addresses(v)

for address in v:
_LOGGER.debug(f"registering receiver {address} -> {self.synced_entity_id}")
await self.hass.services.async_call(
Expand Down

0 comments on commit 6d1f30c

Please sign in to comment.