From c066067c39b7e8564af627fc433b86d7be53567d Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 29 Sep 2026 12:06:39 +0200 Subject: [PATCH] Construct a DeviceInfo object in flux_led (#183560) Co-authored-by: Claude Opus 5 --- homeassistant/components/flux_led/entity.py | 26 +++++++-------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/homeassistant/components/flux_led/entity.py b/homeassistant/components/flux_led/entity.py index ff7f70de823a..09d592be2d6b 100644 --- a/homeassistant/components/flux_led/entity.py +++ b/homeassistant/components/flux_led/entity.py @@ -6,17 +6,7 @@ from typing import Any, override from flux_led.aiodevice import AIOWifiLedBulb from homeassistant import config_entries -from homeassistant.const import ( - ATTR_CONNECTIONS, - ATTR_HW_VERSION, - ATTR_IDENTIFIERS, - ATTR_MANUFACTURER, - ATTR_MODEL, - ATTR_NAME, - ATTR_SW_VERSION, - CONF_MODEL, - CONF_NAME, -) +from homeassistant.const import ATTR_CONNECTIONS, ATTR_HW_VERSION, CONF_MODEL, CONF_NAME from homeassistant.core import callback from homeassistant.helpers import device_registry as dr from homeassistant.helpers.device_registry import DeviceInfo @@ -37,13 +27,13 @@ def _async_device_info( sw_version_str = f"{sw_version:0.2f}" else: sw_version_str = str(device.version_num) - device_info: DeviceInfo = { - ATTR_IDENTIFIERS: {(DOMAIN, entry.entry_id)}, - ATTR_MANUFACTURER: "Zengge", - ATTR_MODEL: device.model, - ATTR_NAME: entry.data.get(CONF_NAME, entry.title), - ATTR_SW_VERSION: sw_version_str, - } + device_info = DeviceInfo( + identifiers={(DOMAIN, entry.entry_id)}, + manufacturer="Zengge", + model=device.model, + name=entry.data.get(CONF_NAME, entry.title), + sw_version=sw_version_str, + ) if hw_model := entry.data.get(CONF_MODEL): device_info[ATTR_HW_VERSION] = hw_model if entry.unique_id: