From 84b483673ec6fdaacc2a5f24ca5e7a756d9bb6d1 Mon Sep 17 00:00:00 2001 From: Robert Svensson Date: Sun, 23 Jan 2022 07:43:07 +0100 Subject: [PATCH] Remove system info from deCONZ diagnostics (#64704) --- .../components/deconz/diagnostics.py | 2 - tests/components/deconz/test_diagnostics.py | 59 ++++++++----------- 2 files changed, 25 insertions(+), 36 deletions(-) diff --git a/homeassistant/components/deconz/diagnostics.py b/homeassistant/components/deconz/diagnostics.py index 9417f9cd23f..f89c7c09849 100644 --- a/homeassistant/components/deconz/diagnostics.py +++ b/homeassistant/components/deconz/diagnostics.py @@ -5,7 +5,6 @@ from typing import Any from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant -from homeassistant.helpers.system_info import async_get_system_info 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) diag: dict[str, Any] = {} - diag["home_assistant"] = await async_get_system_info(hass) diag["config_entry"] = dict(config_entry.data) diag["deconz_config"] = gateway.api.config.raw diag["websocket_state"] = gateway.api.websocket.state diff --git a/tests/components/deconz/test_diagnostics.py b/tests/components/deconz/test_diagnostics.py index 078fed475eb..2602e97176f 100644 --- a/tests/components/deconz/test_diagnostics.py +++ b/tests/components/deconz/test_diagnostics.py @@ -1,7 +1,5 @@ """Test deCONZ diagnostics.""" -from unittest.mock import patch - from pydeconz.websocket import STATE_RUNNING from homeassistant.const import Platform @@ -20,35 +18,28 @@ async def test_entry_diagnostics( await mock_deconz_websocket(state=STATE_RUNNING) await hass.async_block_till_done() - with patch( - "homeassistant.helpers.system_info.async_get_system_info", - return_value={"get_system_info": "fake data"}, - ): - assert await get_diagnostics_for_config_entry( - hass, hass_client, config_entry - ) == { - "home_assistant": {"get_system_info": "fake data"}, - "config_entry": dict(config_entry.data), - "deconz_config": DECONZ_CONFIG, - "websocket_state": STATE_RUNNING, - "deconz_ids": {}, - "entities": { - str(Platform.ALARM_CONTROL_PANEL): [], - str(Platform.BINARY_SENSOR): [], - str(Platform.CLIMATE): [], - str(Platform.COVER): [], - str(Platform.FAN): [], - str(Platform.LIGHT): [], - str(Platform.LOCK): [], - str(Platform.NUMBER): [], - str(Platform.SENSOR): [], - str(Platform.SIREN): [], - str(Platform.SWITCH): [], - }, - "events": {}, - "alarm_systems": {}, - "groups": {}, - "lights": {}, - "scenes": {}, - "sensors": {}, - } + assert await get_diagnostics_for_config_entry(hass, hass_client, config_entry) == { + "config_entry": dict(config_entry.data), + "deconz_config": DECONZ_CONFIG, + "websocket_state": STATE_RUNNING, + "deconz_ids": {}, + "entities": { + str(Platform.ALARM_CONTROL_PANEL): [], + str(Platform.BINARY_SENSOR): [], + str(Platform.CLIMATE): [], + str(Platform.COVER): [], + str(Platform.FAN): [], + str(Platform.LIGHT): [], + str(Platform.LOCK): [], + str(Platform.NUMBER): [], + str(Platform.SENSOR): [], + str(Platform.SIREN): [], + str(Platform.SWITCH): [], + }, + "events": {}, + "alarm_systems": {}, + "groups": {}, + "lights": {}, + "scenes": {}, + "sensors": {}, + }