diff --git a/custom_components/plum_ecomax/diagnostics.py b/custom_components/plum_ecomax/diagnostics.py index aabf352..156ad8f 100644 --- a/custom_components/plum_ecomax/diagnostics.py +++ b/custom_components/plum_ecomax/diagnostics.py @@ -18,6 +18,9 @@ def _redact_device_data(device_data: dict[str, Any]) -> dict[str, Any]: if "product" in device_data: device_data["product"].uid = REDACTED + if "password" in device_data: + device_data["password"] = REDACTED + return device_data diff --git a/tests/test_diagnostics.py b/tests/test_diagnostics.py index 9a506bd..5b7d975 100644 --- a/tests/test_diagnostics.py +++ b/tests/test_diagnostics.py @@ -23,6 +23,7 @@ async def test_diagnostics(hass: HomeAssistant, config_entry: ConfigEntry): mock_connection.device.data = { "test_data": "test_value", "product": mock_product_info, + "password": "0000", } hass.data.setdefault(DOMAIN, {})[config_entry.entry_id] = mock_connection result = await async_get_config_entry_diagnostics(hass, config_entry) @@ -40,5 +41,9 @@ async def test_diagnostics(hass: HomeAssistant, config_entry: ConfigEntry): "capabilities": ["fuel_burned", "heating_temp"], }, } - assert result["data"] == {"test_data": "test_value", "product": mock_product_info} + assert result["data"] == { + "test_data": "test_value", + "product": mock_product_info, + "password": REDACTED, + } assert mock_product_info.uid == REDACTED