J. Nick Koston 03ead27f6c
Split august and yale integrations (#124677)
* Split august and yale integrations [part 1] (#122253)

* merge with dev

* Remove unused constant

* Remove yale IPv6 workaround (#123409)

* Convert yale to use oauth (#123806)

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update yale for switch from pubnub to websockets (#124675)

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-08-28 17:46:03 +02:00

50 lines
1.2 KiB
Python

"""Diagnostics support for yale."""
from __future__ import annotations
from typing import Any
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.core import HomeAssistant
from . import YaleConfigEntry
from .const import CONF_BRAND, DEFAULT_BRAND
TO_REDACT = {
"HouseID",
"OfflineKeys",
"installUserID",
"invitations",
"key",
"pins",
"pubsubChannel",
"recentImage",
"remoteOperateSecret",
"users",
"zWaveDSK",
"contentToken",
}
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, entry: YaleConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
data = entry.runtime_data
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
},
"brand": entry.data.get(CONF_BRAND, DEFAULT_BRAND),
}