mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Ensure SimpliSafe diagnostics redact the code
option (#75137)
This commit is contained in:
parent
4a36318d56
commit
ffeac9714f
@ -5,7 +5,7 @@ from typing import Any
|
|||||||
|
|
||||||
from homeassistant.components.diagnostics import async_redact_data
|
from homeassistant.components.diagnostics import async_redact_data
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_ADDRESS, CONF_LOCATION
|
from homeassistant.const import CONF_ADDRESS, CONF_CODE, CONF_LOCATION
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
from . import SimpliSafe
|
from . import SimpliSafe
|
||||||
@ -23,6 +23,7 @@ CONF_WIFI_SSID = "wifi_ssid"
|
|||||||
|
|
||||||
TO_REDACT = {
|
TO_REDACT = {
|
||||||
CONF_ADDRESS,
|
CONF_ADDRESS,
|
||||||
|
CONF_CODE,
|
||||||
CONF_CREDIT_CARD,
|
CONF_CREDIT_CARD,
|
||||||
CONF_EXPIRES,
|
CONF_EXPIRES,
|
||||||
CONF_LOCATION,
|
CONF_LOCATION,
|
||||||
|
@ -43,7 +43,9 @@ def api_fixture(api_auth_state, data_subscription, system_v3, websocket):
|
|||||||
@pytest.fixture(name="config_entry")
|
@pytest.fixture(name="config_entry")
|
||||||
def config_entry_fixture(hass, config, unique_id):
|
def config_entry_fixture(hass, config, unique_id):
|
||||||
"""Define a config entry."""
|
"""Define a config entry."""
|
||||||
entry = MockConfigEntry(domain=DOMAIN, unique_id=unique_id, data=config)
|
entry = MockConfigEntry(
|
||||||
|
domain=DOMAIN, unique_id=unique_id, data=config, options={CONF_CODE: "1234"}
|
||||||
|
)
|
||||||
entry.add_to_hass(hass)
|
entry.add_to_hass(hass)
|
||||||
return entry
|
return entry
|
||||||
|
|
||||||
|
@ -8,7 +8,9 @@ async def test_entry_diagnostics(hass, config_entry, hass_client, setup_simplisa
|
|||||||
"""Test config entry diagnostics."""
|
"""Test config entry diagnostics."""
|
||||||
assert await get_diagnostics_for_config_entry(hass, hass_client, config_entry) == {
|
assert await get_diagnostics_for_config_entry(hass, hass_client, config_entry) == {
|
||||||
"entry": {
|
"entry": {
|
||||||
"options": {},
|
"options": {
|
||||||
|
"code": REDACTED,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
"subscription_data": {
|
"subscription_data": {
|
||||||
"system_123": {
|
"system_123": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user