From 5ccc5190c3a772a057c87165850ddf8c4ea66285 Mon Sep 17 00:00:00 2001 From: ElD4n1 Date: Wed, 4 Dec 2024 13:38:05 +0100 Subject: [PATCH] Fix device info --- custom_components/bmstools/device.py | 10 ++++++++-- custom_components/bmstools/manifest.json | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/custom_components/bmstools/device.py b/custom_components/bmstools/device.py index fbfb5d5..7ca9391 100644 --- a/custom_components/bmstools/device.py +++ b/custom_components/bmstools/device.py @@ -46,11 +46,17 @@ def unique_id(self) -> str | None: @property def device_info(self) -> DeviceInfo: """Return device specific attributes.""" - return { + device_info = { ATTR_IDENTIFIERS: {(DOMAIN, self._config_entry_data[ATTR_SERIAL_NUMBER])}, ATTR_MANUFACTURER: MANUFACTURER, ATTR_MODEL: self._config_entry_data[ATTR_MODEL], ATTR_SW_VERSION: self._config_entry_data[ATTR_SW_VERSION], ATTR_HW_VERSION: self._config_entry_data[ATTR_HW_VERSION], - ATTR_DEFAULT_NAME: DEFAULT_DEVICE_NAME, + ATTR_MODEL_ID: self._config_entry_data[ATTR_MODEL], + ATTR_NAME: f"{MANUFACTURER} {DEFAULT_DEVICE_NAME} {self._config_entry_data[ATTR_MODEL]}", } + + if ATTR_SERIAL_NUMBER in self._config_entry_data: + device_info.ATTR_SERIAL_NUMBER = self._config_entry_data[ATTR_SERIAL_NUMBER] + + return device_info \ No newline at end of file diff --git a/custom_components/bmstools/manifest.json b/custom_components/bmstools/manifest.json index 6351288..00e961d 100644 --- a/custom_components/bmstools/manifest.json +++ b/custom_components/bmstools/manifest.json @@ -6,7 +6,7 @@ "documentation": "https://github.com/ElD4n1/home-assistant-bms-tools-integration", "issue_tracker": "https://github.com/ElD4n1/home-assistant-bms-tools-integration/issues", "requirements": [ - "bmstools==1.2.0rc1" + "bmstools==1.2.1-beta.1" ], "ssdp": [], "zeroconf": [],