Remove system info from deCONZ diagnostics (#64704)

This commit is contained in:
Robert Svensson 2022-01-23 07:43:07 +01:00 committed by GitHub
parent d5211c12b0
commit 84b483673e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 36 deletions

View File

@ -5,7 +5,6 @@ from typing import Any
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers.system_info import async_get_system_info
from .gateway import get_gateway_from_config_entry from .gateway import get_gateway_from_config_entry
@ -17,7 +16,6 @@ async def async_get_config_entry_diagnostics(
gateway = get_gateway_from_config_entry(hass, config_entry) gateway = get_gateway_from_config_entry(hass, config_entry)
diag: dict[str, Any] = {} diag: dict[str, Any] = {}
diag["home_assistant"] = await async_get_system_info(hass)
diag["config_entry"] = dict(config_entry.data) diag["config_entry"] = dict(config_entry.data)
diag["deconz_config"] = gateway.api.config.raw diag["deconz_config"] = gateway.api.config.raw
diag["websocket_state"] = gateway.api.websocket.state diag["websocket_state"] = gateway.api.websocket.state

View File

@ -1,7 +1,5 @@
"""Test deCONZ diagnostics.""" """Test deCONZ diagnostics."""
from unittest.mock import patch
from pydeconz.websocket import STATE_RUNNING from pydeconz.websocket import STATE_RUNNING
from homeassistant.const import Platform from homeassistant.const import Platform
@ -20,35 +18,28 @@ async def test_entry_diagnostics(
await mock_deconz_websocket(state=STATE_RUNNING) await mock_deconz_websocket(state=STATE_RUNNING)
await hass.async_block_till_done() await hass.async_block_till_done()
with patch( assert await get_diagnostics_for_config_entry(hass, hass_client, config_entry) == {
"homeassistant.helpers.system_info.async_get_system_info", "config_entry": dict(config_entry.data),
return_value={"get_system_info": "fake data"}, "deconz_config": DECONZ_CONFIG,
): "websocket_state": STATE_RUNNING,
assert await get_diagnostics_for_config_entry( "deconz_ids": {},
hass, hass_client, config_entry "entities": {
) == { str(Platform.ALARM_CONTROL_PANEL): [],
"home_assistant": {"get_system_info": "fake data"}, str(Platform.BINARY_SENSOR): [],
"config_entry": dict(config_entry.data), str(Platform.CLIMATE): [],
"deconz_config": DECONZ_CONFIG, str(Platform.COVER): [],
"websocket_state": STATE_RUNNING, str(Platform.FAN): [],
"deconz_ids": {}, str(Platform.LIGHT): [],
"entities": { str(Platform.LOCK): [],
str(Platform.ALARM_CONTROL_PANEL): [], str(Platform.NUMBER): [],
str(Platform.BINARY_SENSOR): [], str(Platform.SENSOR): [],
str(Platform.CLIMATE): [], str(Platform.SIREN): [],
str(Platform.COVER): [], str(Platform.SWITCH): [],
str(Platform.FAN): [], },
str(Platform.LIGHT): [], "events": {},
str(Platform.LOCK): [], "alarm_systems": {},
str(Platform.NUMBER): [], "groups": {},
str(Platform.SENSOR): [], "lights": {},
str(Platform.SIREN): [], "scenes": {},
str(Platform.SWITCH): [], "sensors": {},
}, }
"events": {},
"alarm_systems": {},
"groups": {},
"lights": {},
"scenes": {},
"sensors": {},
}