From 8e384ab5984c4d2b95f1b5b407aad684763a0553 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Mon, 1 Apr 2024 23:55:14 +0200 Subject: [PATCH] Use dict comprehension in honeywell diagnostics (#114598) --- .../components/honeywell/diagnostics.py | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/homeassistant/components/honeywell/diagnostics.py b/homeassistant/components/honeywell/diagnostics.py index b489eb4a596..35624c8fc39 100644 --- a/homeassistant/components/honeywell/diagnostics.py +++ b/homeassistant/components/honeywell/diagnostics.py @@ -16,19 +16,13 @@ async def async_get_config_entry_diagnostics( config_entry: ConfigEntry, ) -> dict[str, Any]: """Return diagnostics for a config entry.""" + honeywell: HoneywellData = hass.data[DOMAIN][config_entry.entry_id] - Honeywell: HoneywellData = hass.data[DOMAIN][config_entry.entry_id] - diagnostics_data = {} - - for device, module in Honeywell.devices.items(): - diagnostics_data.update( - { - f"Device {device}": { - "UI Data": module.raw_ui_data, - "Fan Data": module.raw_fan_data, - "DR Data": module.raw_dr_data, - } - } - ) - - return diagnostics_data + return { + f"Device {device}": { + "UI Data": module.raw_ui_data, + "Fan Data": module.raw_fan_data, + "DR Data": module.raw_dr_data, + } + for device, module in honeywell.devices.items() + }