mirror of
https://github.com/home-assistant/core.git
synced 2026-10-06 22:38:02 -04:00
Redact AccessoryIPs in HomeKit Controller diagnostics (#183779)
This commit is contained in:
@@ -19,6 +19,7 @@ REDACTED_CHARACTERISTICS = [
|
||||
|
||||
REDACTED_CONFIG_ENTRY_KEYS = [
|
||||
"AccessoryIP",
|
||||
"AccessoryIPs",
|
||||
"iOSDeviceLTSK",
|
||||
]
|
||||
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
dict({
|
||||
'config-entry': dict({
|
||||
'data': dict({
|
||||
'AccessoryIP': '**REDACTED**',
|
||||
'AccessoryIPs': '**REDACTED**',
|
||||
'AccessoryPairingID': '00:00:00:00:00:00',
|
||||
'AccessoryPort': 51826,
|
||||
}),
|
||||
'title': 'test',
|
||||
'version': 1,
|
||||
@@ -326,7 +329,10 @@
|
||||
dict({
|
||||
'config-entry': dict({
|
||||
'data': dict({
|
||||
'AccessoryIP': '**REDACTED**',
|
||||
'AccessoryIPs': '**REDACTED**',
|
||||
'AccessoryPairingID': '00:00:00:00:00:00',
|
||||
'AccessoryPort': 51826,
|
||||
}),
|
||||
'title': 'test',
|
||||
'version': 1,
|
||||
|
||||
@@ -15,6 +15,12 @@ from tests.components.diagnostics import (
|
||||
)
|
||||
from tests.typing import ClientSessionGenerator
|
||||
|
||||
IP_CONNECTION_DATA = {
|
||||
"AccessoryIP": "192.168.1.10",
|
||||
"AccessoryIPs": ["192.168.1.10", "2001:db8::10", "fd00::10"],
|
||||
"AccessoryPort": 51826,
|
||||
}
|
||||
|
||||
|
||||
async def test_config_entry(
|
||||
hass: HomeAssistant,
|
||||
@@ -24,6 +30,9 @@ async def test_config_entry(
|
||||
"""Test generating diagnostics for a config entry."""
|
||||
accessories = await setup_accessories_from_file(hass, "koogeek_ls1.json")
|
||||
config_entry, _ = await setup_test_accessories(hass, accessories)
|
||||
hass.config_entries.async_update_entry(
|
||||
config_entry, data={**config_entry.data, **IP_CONNECTION_DATA}
|
||||
)
|
||||
|
||||
diag = await get_diagnostics_for_config_entry(hass, hass_client, config_entry)
|
||||
|
||||
@@ -41,6 +50,9 @@ async def test_device(
|
||||
"""Test generating diagnostics for a device entry."""
|
||||
accessories = await setup_accessories_from_file(hass, "koogeek_ls1.json")
|
||||
config_entry, _ = await setup_test_accessories(hass, accessories)
|
||||
hass.config_entries.async_update_entry(
|
||||
config_entry, data={**config_entry.data, **IP_CONNECTION_DATA}
|
||||
)
|
||||
|
||||
connection = hass.data[KNOWN_DEVICES]["00:00:00:00:00:00"]
|
||||
device = device_registry.async_get(connection.devices[1])
|
||||
|
||||
Reference in New Issue
Block a user