Skip to content

ESPHome 2026.4.0: Lock callback signature changed #78

Description

@bdraco

Summary

ESPHome 2026.4.0 changes Lock::add_on_state_callback to pass state as an argument (PR #15199). The callback signature changed from void() to void(LockState).

Current usage

components/homekit/lock.hpp — [this]() zero-arg lambda

Recommended migration

// Before
lock->add_on_state_callback([this]() {
  auto state = lock->state;
  // ...
});

// After
lock->add_on_state_callback([this](LockState state) {
  // state is passed directly
});

References

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions