Skip to content

[ISSUE] async_step_reauth crashes on None user_input when configured lock entity is missing #1348

Description

@CodeKlopfer

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).

Activity

  1. raman325 commented on Jul 16, 2026

    @raman325
    Owner

    thanks for the report, had Claude write this up in addition to the bug fix: https://github.com/raman325/lock_code_manager/wiki/Adding-and-Removing-Locks

  2. CodeKlopfer commented on Jul 18, 2026

    @CodeKlopfer
    Author

    Thanks for fast fix and the new description!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions