Add redacted subscription data to SimpliSafe diagnostics (#65751)

This commit is contained in:
Aaron Bach 2022-02-05 00:41:12 -07:00 committed by GitHub
parent b9b53bef00
commit 3387e8368b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 109 additions and 3 deletions

View file

@ -11,14 +11,28 @@ from homeassistant.core import HomeAssistant
from . import SimpliSafe
from .const import DOMAIN
CONF_CREDIT_CARD = "creditCard"
CONF_EXPIRES = "expires"
CONF_LOCATION = "location"
CONF_LOCATION_NAME = "locationName"
CONF_PAYMENT_PROFILE_ID = "paymentProfileId"
CONF_SERIAL = "serial"
CONF_SID = "sid"
CONF_SYSTEM_ID = "system_id"
CONF_UID = "uid"
CONF_WIFI_SSID = "wifi_ssid"
TO_REDACT = {
CONF_ADDRESS,
CONF_CREDIT_CARD,
CONF_EXPIRES,
CONF_LOCATION,
CONF_LOCATION_NAME,
CONF_PAYMENT_PROFILE_ID,
CONF_SERIAL,
CONF_SID,
CONF_SYSTEM_ID,
CONF_UID,
CONF_WIFI_SSID,
}
@ -34,6 +48,7 @@ async def async_get_config_entry_diagnostics(
"entry": {
"options": dict(entry.options),
},
"subscription_data": simplisafe.subscription_data,
"systems": [system.as_dict() for system in simplisafe.systems.values()],
},
TO_REDACT,