diff --git a/homeassistant/components/reolink/__init__.py b/homeassistant/components/reolink/__init__.py index e9b1d7e8c37..1d933a84ebd 100644 --- a/homeassistant/components/reolink/__init__.py +++ b/homeassistant/components/reolink/__init__.py @@ -228,7 +228,7 @@ def migrate_entity_ids( entity_reg = er.async_get(hass) entities = er.async_entries_for_config_entry(entity_reg, config_entry_id) for entity in entities: - # Can be remove in HA 2025.1.0 + # Can be removed in HA 2025.1.0 if entity.domain == "update" and entity.unique_id == host.unique_id: entity_reg.async_update_entity( entity.entity_id, new_unique_id=f"{host.unique_id}_firmware" diff --git a/homeassistant/components/reolink/entity.py b/homeassistant/components/reolink/entity.py index f722944a2fc..89c98ad0885 100644 --- a/homeassistant/components/reolink/entity.py +++ b/homeassistant/components/reolink/entity.py @@ -127,6 +127,7 @@ class ReolinkChannelCoordinatorEntity(ReolinkHostCoordinatorEntity): name=self._host.api.camera_name(dev_ch), model=self._host.api.camera_model(dev_ch), manufacturer=self._host.api.manufacturer, + hw_version=self._host.api.camera_hardware_version(dev_ch), sw_version=self._host.api.camera_sw_version(dev_ch), serial_number=self._host.api.camera_uid(dev_ch), configuration_url=self._conf_url, diff --git a/homeassistant/components/reolink/host.py b/homeassistant/components/reolink/host.py index 8256ef7f017..9836c5d7a01 100644 --- a/homeassistant/components/reolink/host.py +++ b/homeassistant/components/reolink/host.py @@ -237,25 +237,35 @@ class ReolinkHost: self._async_check_onvif_long_poll, ) - if self._api.sw_version_update_required: - ir.async_create_issue( - self._hass, - DOMAIN, - "firmware_update", - is_fixable=False, - severity=ir.IssueSeverity.WARNING, - translation_key="firmware_update", - translation_placeholders={ - "required_firmware": self._api.sw_version_required.version_string, - "current_firmware": self._api.sw_version, - "model": self._api.model, - "hw_version": self._api.hardware_version, - "name": self._api.nvr_name, - "download_link": "https://reolink.com/download-center/", - }, - ) - else: - ir.async_delete_issue(self._hass, DOMAIN, "firmware_update") + ch_list: list[int | None] = [None] + if self._api.is_nvr: + ch_list.extend(self._api.channels) + for ch in ch_list: + if not self._api.supported(ch, "firmware"): + continue + + key = ch if ch is not None else "host" + if self._api.camera_sw_version_update_required(ch): + ir.async_create_issue( + self._hass, + DOMAIN, + f"firmware_update_{key}", + is_fixable=False, + severity=ir.IssueSeverity.WARNING, + translation_key="firmware_update", + translation_placeholders={ + "required_firmware": self._api.camera_sw_version_required( + ch + ).version_string, + "current_firmware": self._api.camera_sw_version(ch), + "model": self._api.camera_model(ch), + "hw_version": self._api.camera_hardware_version(ch), + "name": self._api.camera_name(ch), + "download_link": "https://reolink.com/download-center/", + }, + ) + else: + ir.async_delete_issue(self._hass, DOMAIN, f"firmware_update_{key}") async def _async_check_onvif(self, *_) -> None: """Check the ONVIF subscription.""" diff --git a/tests/components/reolink/test_init.py b/tests/components/reolink/test_init.py index 3cca1831a28..db6069b097c 100644 --- a/tests/components/reolink/test_init.py +++ b/tests/components/reolink/test_init.py @@ -330,4 +330,4 @@ async def test_firmware_repair_issue( assert await hass.config_entries.async_setup(config_entry.entry_id) await hass.async_block_till_done() - assert (const.DOMAIN, "firmware_update") in issue_registry.issues + assert (const.DOMAIN, "firmware_update_host") in issue_registry.issues