From cc4637a703526403baf64d50169b09c49a52bd01 Mon Sep 17 00:00:00 2001 From: Jan Bouwhuis Date: Fri, 5 Jun 2026 12:12:34 +0200 Subject: [PATCH] Create certificate files before trying to migrate the MQTT config entry (#173087) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- homeassistant/components/mqtt/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/mqtt/__init__.py b/homeassistant/components/mqtt/__init__.py index 72f8966ad718..47c6cf27bc24 100644 --- a/homeassistant/components/mqtt/__init__.py +++ b/homeassistant/components/mqtt/__init__.py @@ -504,6 +504,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: # Can be removed with HA Core 2027.1 new_entry_data = entry.data.copy() new_entry_data[CONF_PROTOCOL] = PROTOCOL_5 + # Create temporary certificate files from entry + await async_create_certificate_temp_files(hass, new_entry_data) # Try the connection with protocol version 5 # And update the protocol if successful if await hass.async_add_executor_job(