1 """Diagnostics support for generic (IP camera)."""
3 from __future__
import annotations
14 from .const
import CONF_STILL_IMAGE_URL, CONF_STREAM_SOURCE
24 """Redact credentials from string url."""
25 url = url_in = yarl.URL(data)
29 url = url.with_user(
"****")
32 url = url.with_password(
"****")
33 if url_in.path !=
"/":
34 url = url.with_path(
"****")
36 if url_in.query_string:
37 url = url.with_query(
"****=****")
42 hass: HomeAssistant, entry: ConfigEntry
44 """Return diagnostics for a config entry."""
46 for key
in (CONF_STREAM_SOURCE, CONF_STILL_IMAGE_URL):
47 if (value := options.get(key))
is not None:
dict async_redact_data(Mapping data, Iterable[Any] to_redact)
dict[str, Any] async_get_config_entry_diagnostics(HomeAssistant hass, ConfigEntry entry)