Deprecated device info constants
As of Home Assistant Core 2026.12, the device info constants in homeassistant.const are deprecated, because Home Assistant Core no longer uses them. They will be removed in Home Assistant Core 2027.12. Until then, using one of them logs a warning. If your custom integration doesn't import any of these constants, you don't need to do anything:
ATTR_CONFIGURATION_URLATTR_CONNECTIONSATTR_DEFAULT_NAMEATTR_HW_VERSIONATTR_IDENTIFIERSATTR_MANUFACTURERATTR_MODELATTR_MODEL_IDATTR_SERIAL_NUMBERATTR_SUGGESTED_AREAATTR_SW_VERSION
Since Home Assistant Core 2026.11, DeviceInfo is a dataclass with typed fields, so you can use its fields directly, without these constants.
Use the DeviceInfo keyword arguments and attributes instead. Each field has the same name as the value of its constant:
# Old
device_info[ATTR_SW_VERSION] = "1.2.3"
model = device_info[ATTR_MODEL]
# New
device_info.sw_version = "1.2.3"
model = device_info.model# Old
device_registry.async_get_or_create(
config_entry_id=entry.entry_id,
**{
ATTR_IDENTIFIERS: {(DOMAIN, unique_id)},
ATTR_MANUFACTURER: "My manufacturer",
},
)
# New
device_registry.async_get_or_create(
config_entry_id=entry.entry_id,
identifiers={(DOMAIN, unique_id)},
manufacturer="My manufacturer",
)There is one exception: ATTR_DEFAULT_NAME. The default_name field is deprecated too, and will be removed in Home Assistant Core 2027.9. Use name instead.
If your integration uses one of these constants for its own data, like a state attribute, use a plain string or a local constant instead:
# Old
from homeassistant.const import ATTR_MODEL
ATTRIBUTES = {ATTR_MODEL: "My model"}
# New
ATTR_MODEL = "model"
ATTRIBUTES = {ATTR_MODEL: "My model"}