Skip to content

Commit

Permalink
Add interface_id to identifiers in device_info (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
SukramJ authored Dec 21, 2021
1 parent 784e85e commit 87552b4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions hahomematic/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
7 changes: 2 additions & 5 deletions hahomematic/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])

Expand Down

0 comments on commit 87552b4

Please sign in to comment.