From 777ae584d49e45a074f74cdff47f0706597907c8 Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Fri, 4 Mar 2022 23:43:33 +0100 Subject: [PATCH] Add unique_id to Fritz diagnostics (#67384) Co-authored-by: Paulus Schoutsen --- homeassistant/components/fritz/diagnostics.py | 3 +++ tests/components/fritz/test_diagnostics.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/fritz/diagnostics.py b/homeassistant/components/fritz/diagnostics.py index fa4ff6a7db8..ed45295892b 100644 --- a/homeassistant/components/fritz/diagnostics.py +++ b/homeassistant/components/fritz/diagnostics.py @@ -22,6 +22,9 @@ async def async_get_config_entry_diagnostics( "entry": async_redact_data(entry.as_dict(), TO_REDACT), "device_info": { "model": avm_wrapper.model, + "unique_id": avm_wrapper.unique_id.replace( + avm_wrapper.unique_id[6:11], "XX:XX" + ), "current_firmware": avm_wrapper.current_firmware, "latest_firmware": avm_wrapper.latest_firmware, "update_available": avm_wrapper.update_available, diff --git a/tests/components/fritz/test_diagnostics.py b/tests/components/fritz/test_diagnostics.py index 892210d0844..a4b4942c375 100644 --- a/tests/components/fritz/test_diagnostics.py +++ b/tests/components/fritz/test_diagnostics.py @@ -11,7 +11,7 @@ from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant from homeassistant.setup import async_setup_component -from .const import MOCK_USER_DATA +from .const import MOCK_MESH_MASTER_MAC, MOCK_USER_DATA from tests.common import MockConfigEntry from tests.components.diagnostics import get_diagnostics_for_config_entry @@ -69,6 +69,7 @@ async def test_entry_diagnostics( "latest_firmware": None, "mesh_role": "master", "model": "FRITZ!Box 7530 AX", + "unique_id": MOCK_MESH_MASTER_MAC.replace("6F:12", "XX:XX"), "update_available": False, "wan_link_properties": { "NewLayer1DownstreamMaxBitRate": 318557000,