Drop unnecessary default=0 from config.get(_KEY_*_IDX) calls

This commit is contained in:
J. Nick Koston
2026-03-06 11:18:44 -10:00
parent 2852d86a2f
commit dfa8c683dc
+3 -3
View File
@@ -250,11 +250,11 @@ def _describe_packed_flags(config: ConfigType, entity_category: int) -> str:
cat_name := entity_cat_keys[entity_category]
):
parts.append(f"category:{cat_name}")
if config.get(_KEY_DC_IDX, 0) and (dc := config.get(CONF_DEVICE_CLASS)):
if config.get(_KEY_DC_IDX) and (dc := config.get(CONF_DEVICE_CLASS)):
parts.append(f"dc:{_sanitize_comment(dc)}")
if config.get(_KEY_UOM_IDX, 0) and (uom := config.get(CONF_UNIT_OF_MEASUREMENT)):
if config.get(_KEY_UOM_IDX) and (uom := config.get(CONF_UNIT_OF_MEASUREMENT)):
parts.append(f"uom:{_sanitize_comment(uom)}")
if config.get(_KEY_ICON_IDX, 0) and (icon := config.get(CONF_ICON)):
if config.get(_KEY_ICON_IDX) and (icon := config.get(CONF_ICON)):
parts.append(f"icon:{_sanitize_comment(icon)}")
return ", ".join(parts)