Add diagnostics to august (#68157)
This commit is contained in:
parent
ed24638201
commit
65c670c2c7
12 changed files with 217 additions and 32 deletions
47
homeassistant/components/august/diagnostics.py
Normal file
47
homeassistant/components/august/diagnostics.py
Normal file
|
@ -0,0 +1,47 @@
|
|||
"""Diagnostics support for august."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from homeassistant.components.diagnostics import async_redact_data
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from . import AugustData
|
||||
from .const import DOMAIN
|
||||
|
||||
TO_REDACT = {
|
||||
"HouseID",
|
||||
"OfflineKeys",
|
||||
"installUserID",
|
||||
"invitations",
|
||||
"key",
|
||||
"pins",
|
||||
"pubsubChannel",
|
||||
"recentImage",
|
||||
"remoteOperateSecret",
|
||||
"users",
|
||||
"zWaveDSK",
|
||||
}
|
||||
|
||||
|
||||
async def async_get_config_entry_diagnostics(
|
||||
hass: HomeAssistant, entry: ConfigEntry
|
||||
) -> dict[str, Any]:
|
||||
"""Return diagnostics for a config entry."""
|
||||
data: AugustData = hass.data[DOMAIN][entry.entry_id]
|
||||
|
||||
return {
|
||||
"locks": {
|
||||
lock.device_id: async_redact_data(
|
||||
data.get_device_detail(lock.device_id).raw, TO_REDACT
|
||||
)
|
||||
for lock in data.locks
|
||||
},
|
||||
"doorbells": {
|
||||
doorbell.device_id: async_redact_data(
|
||||
data.get_device_detail(doorbell.device_id).raw, TO_REDACT
|
||||
)
|
||||
for doorbell in data.doorbells
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue