Update Netatmo diagnostics (#64610)
This commit is contained in:
parent
954caa93b5
commit
aecb342fda
2 changed files with 16 additions and 7 deletions
|
@ -6,7 +6,7 @@ from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
from .const import DATA_HANDLER, DOMAIN
|
from .const import DATA_HANDLER, DOMAIN
|
||||||
from .data_handler import NetatmoDataHandler
|
from .data_handler import CLIMATE_TOPOLOGY_CLASS_NAME, NetatmoDataHandler
|
||||||
|
|
||||||
TO_REDACT = {
|
TO_REDACT = {
|
||||||
"access_token",
|
"access_token",
|
||||||
|
@ -14,10 +14,17 @@ TO_REDACT = {
|
||||||
"restricted_access_token",
|
"restricted_access_token",
|
||||||
"restricted_refresh_token",
|
"restricted_refresh_token",
|
||||||
"webhook_id",
|
"webhook_id",
|
||||||
|
"cloudhook_url",
|
||||||
"lat_ne",
|
"lat_ne",
|
||||||
"lat_sw",
|
"lat_sw",
|
||||||
"lon_ne",
|
"lon_ne",
|
||||||
"lon_sw",
|
"lon_sw",
|
||||||
|
"coordinates",
|
||||||
|
"name",
|
||||||
|
"timetable",
|
||||||
|
"zones",
|
||||||
|
"pseudo",
|
||||||
|
"url",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,5 +44,10 @@ async def async_get_config_entry_diagnostics(
|
||||||
},
|
},
|
||||||
TO_REDACT,
|
TO_REDACT,
|
||||||
),
|
),
|
||||||
"data": async_redact_data(data_handler.data, TO_REDACT),
|
"data": {
|
||||||
|
CLIMATE_TOPOLOGY_CLASS_NAME: async_redact_data(
|
||||||
|
getattr(data_handler.data[CLIMATE_TOPOLOGY_CLASS_NAME], "raw_data"),
|
||||||
|
TO_REDACT,
|
||||||
|
)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,8 +88,5 @@ async def test_entry_diagnostics(hass, hass_client, config_entry):
|
||||||
"webhook_registered": False,
|
"webhook_registered": False,
|
||||||
}
|
}
|
||||||
|
|
||||||
assert result["data"]["AsyncClimate-111111111111111111111401"] is None
|
for home in result["data"]["AsyncClimateTopology"]["homes"]:
|
||||||
assert (
|
assert home["coordinates"] == REDACTED
|
||||||
result["data"]["AsyncClimate-91763b24c43d3e344f424e8b"]["repr"]
|
|
||||||
== "AsyncClimate(home_id=91763b24c43d3e344f424e8b)"
|
|
||||||
)
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue