What happened?
When a configured lock entity is deleted from Home Assistant but still referenced in a Lock Code Manager config entry, the integration fails to start and the reauth flow crashes when the UI tries to open it.
On startup, the config entry fails with:
ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Türschlösser for lock_code_manager: Unable to start because lock lock.aqara_smart_lock_u200 can't be found
homeassistant.exceptions.ConfigEntryError: Unable to start because lock lock.aqara_smart_lock_u200 can't be found
A reauth flow is started, but opening it in the UI crashes:
File "/config/custom_components/lock_code_manager/config_flow.py", line 500, in async_step_reauth if CONF_SLOTS not in user_input: TypeError: argument of type 'NoneType' is not a container or iterable
Steps to reproduce the issue
1.Configure Lock Code Manager with one or more locks (e.g. lock.aqara_smart_lock_u200).
2.Remove one of those lock entities from Home Assistant (delete device/entity).
3.Restart Home Assistant (or upgrade LCM).
4.Observe that the LCM config entry fails to load.
5.Attempt to resolve via the reauth notification / config flow in the UI.
Home Assistant Version
2026.7.1
What version of Lock Code Manager are you running?
4.3.0
Lock make and model
Aqara U200
Debug logs (paste)
Debug logs (upload)
home-assistant_2026-07-16T13-55-07.688Z.log
Lock Code Manager diagnostics (upload)
No response
Lock integration diagnostics (upload)
No response
Diagnostics (paste)
Browser console logs (paste)
Browser console logs (upload)
No response
Screenshots
No response
Anything else?
Workaround used
Manually edit /config/.storage/core.config_entries, find the LCM entry, and remove the deleted lock entity ID from the locks array.
Documentation gap
The wiki does not describe how to remove a lock from an existing LCM config entry, nor how to recover when a lock entity was deleted outside LCM (including the manual core.config_entries edit workaround).
What happened?
When a configured lock entity is deleted from Home Assistant but still referenced in a Lock Code Manager config entry, the integration fails to start and the reauth flow crashes when the UI tries to open it.
On startup, the config entry fails with:
A reauth flow is started, but opening it in the UI crashes:
Steps to reproduce the issue
1.Configure Lock Code Manager with one or more locks (e.g. lock.aqara_smart_lock_u200).
2.Remove one of those lock entities from Home Assistant (delete device/entity).
3.Restart Home Assistant (or upgrade LCM).
4.Observe that the LCM config entry fails to load.
5.Attempt to resolve via the reauth notification / config flow in the UI.
Home Assistant Version
2026.7.1
What version of Lock Code Manager are you running?
4.3.0
Lock make and model
Aqara U200
Debug logs (paste)
Debug logs (upload)
home-assistant_2026-07-16T13-55-07.688Z.log
Lock Code Manager diagnostics (upload)
No response
Lock integration diagnostics (upload)
No response
Diagnostics (paste)
Browser console logs (paste)
Browser console logs (upload)
No response
Screenshots
No response
Anything else?
Workaround used
Manually edit /config/.storage/core.config_entries, find the LCM entry, and remove the deleted lock entity ID from the locks array.
Documentation gap
The wiki does not describe how to remove a lock from an existing LCM config entry, nor how to recover when a lock entity was deleted outside LCM (including the manual core.config_entries edit workaround).