mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Use whole config entry in deCONZ diagnostics (#64795)
This commit is contained in:
parent
7e20e555dd
commit
425911e850
@ -5,12 +5,12 @@ from typing import Any
|
||||
|
||||
from homeassistant.components.diagnostics import async_redact_data
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_API_KEY
|
||||
from homeassistant.const import CONF_API_KEY, CONF_UNIQUE_ID
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from .gateway import get_gateway_from_config_entry
|
||||
|
||||
REDACT_CONFIG = {CONF_API_KEY}
|
||||
REDACT_CONFIG = {CONF_API_KEY, CONF_UNIQUE_ID}
|
||||
REDACT_DECONZ_CONFIG = {"bridgeid", "mac", "panid"}
|
||||
|
||||
|
||||
@ -21,8 +21,7 @@ async def async_get_config_entry_diagnostics(
|
||||
gateway = get_gateway_from_config_entry(hass, config_entry)
|
||||
diag: dict[str, Any] = {}
|
||||
|
||||
diag["config"] = async_redact_data(config_entry.data, REDACT_CONFIG)
|
||||
diag["options"] = dict(config_entry.options)
|
||||
diag["config"] = async_redact_data(config_entry.as_dict(), REDACT_CONFIG)
|
||||
diag["deconz_config"] = async_redact_data(
|
||||
gateway.api.config.raw, REDACT_DECONZ_CONFIG
|
||||
)
|
||||
|
@ -21,8 +21,19 @@ async def test_entry_diagnostics(
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert await get_diagnostics_for_config_entry(hass, hass_client, config_entry) == {
|
||||
"config": {CONF_API_KEY: REDACTED, CONF_HOST: HOST, CONF_PORT: PORT},
|
||||
"options": {CONF_MASTER_GATEWAY: True},
|
||||
"config": {
|
||||
"data": {CONF_API_KEY: REDACTED, CONF_HOST: HOST, CONF_PORT: PORT},
|
||||
"disabled_by": None,
|
||||
"domain": "deconz",
|
||||
"entry_id": "1",
|
||||
"options": {CONF_MASTER_GATEWAY: True},
|
||||
"pref_disable_new_entities": False,
|
||||
"pref_disable_polling": False,
|
||||
"source": "user",
|
||||
"title": "Mock Title",
|
||||
"unique_id": REDACTED,
|
||||
"version": 1,
|
||||
},
|
||||
"deconz_config": {
|
||||
"bridgeid": REDACTED,
|
||||
"ipaddress": HOST,
|
||||
|
Loading…
x
Reference in New Issue
Block a user