Adapt Roborock to runtime_data (#120578)
* Adopt Roborock to runtime_data * Fix name
This commit is contained in:
parent
ed1eb8ac9c
commit
31e9de3b95
12 changed files with 46 additions and 68 deletions
|
@ -5,12 +5,10 @@ from __future__ import annotations
|
|||
from typing import Any
|
||||
|
||||
from homeassistant.components.diagnostics.util import async_redact_data
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_UNIQUE_ID
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from . import RoborockCoordinators
|
||||
from .const import DOMAIN
|
||||
from . import RoborockConfigEntry
|
||||
|
||||
TO_REDACT_CONFIG = ["token", "sn", "rruid", CONF_UNIQUE_ID, "username", "uid"]
|
||||
|
||||
|
@ -18,10 +16,10 @@ TO_REDACT_COORD = ["duid", "localKey", "mac", "bssid"]
|
|||
|
||||
|
||||
async def async_get_config_entry_diagnostics(
|
||||
hass: HomeAssistant, config_entry: ConfigEntry
|
||||
hass: HomeAssistant, config_entry: RoborockConfigEntry
|
||||
) -> dict[str, Any]:
|
||||
"""Return diagnostics for a config entry."""
|
||||
coordinators: RoborockCoordinators = hass.data[DOMAIN][config_entry.entry_id]
|
||||
coordinators = config_entry.runtime_data
|
||||
|
||||
return {
|
||||
"config_entry": async_redact_data(config_entry.data, TO_REDACT_CONFIG),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue