diff --git a/changelog.txt b/changelog.txt index c343615f..9f801cec 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,7 @@ -Version 0.1.x (2021-12-xx) +Version 0.1.1 (2021-12-21) - Remove unnecessary async - Removed unused helper +- Add interface_id to identifiers in device_info Version 0.1.0 (2021-12-20) - Bump version to 0.1.0 diff --git a/hahomematic/const.py b/hahomematic/const.py index 9fb4188b..083b7ec8 100644 --- a/hahomematic/const.py +++ b/hahomematic/const.py @@ -15,6 +15,7 @@ IP_ANY_V4 = "0.0.0.0" IP_ANY_V6 = "::" PORT_ANY = 0 +IDENTIFIERS_SEPARATOR = "%" PATH_JSON_RPC = "/api/homematic.cgi" diff --git a/hahomematic/device.py b/hahomematic/device.py index 3b92182d..50dca916 100644 --- a/hahomematic/device.py +++ b/hahomematic/device.py @@ -21,6 +21,7 @@ HA_DOMAIN, HH_EVENT_DEVICES_CREATED, HM_VIRTUAL_REMOTES, + IDENTIFIERS_SEPARATOR, IGNORED_PARAMETERS, IGNORED_PARAMETERS_WILDCARDS_END, IGNORED_PARAMETERS_WILDCARDS_START, @@ -214,13 +215,9 @@ def __str__(self) -> str: @property def device_info(self) -> dict[str, Any]: """Return device specific attributes.""" - address = self.address - if self.address in HM_VIRTUAL_REMOTES: - address = f"{self.central.instance_name}_{self.address}" - return { "config_entry_id": self.central.entry_id, - "identifiers": {(HA_DOMAIN, address)}, + "identifiers": {(HA_DOMAIN, f"{self.interface_id}{IDENTIFIERS_SEPARATOR}{self.address}")}, "name": self.name, "manufacturer": "eQ-3", "model": self.device_type, diff --git a/setup.py b/setup.py index 56aa15dc..3b278fae 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ def readme(): }, PACKAGE_NAME = "hahomematic" HERE = os.path.abspath(os.path.dirname(__file__)) -VERSION = "0.1.0" +VERSION = "0.1.1" PACKAGES = find_packages(exclude=["tests", "tests.*", "dist", "build"])