Skip to content

Conversation

@jelofsson
Copy link

@jelofsson jelofsson commented Jan 12, 2026

This fixes a 500 error when opening the Greenely integration Options (Configure) UI.

Background:
Historically integrations could set self.config_entry (though it was discouraged and logged a deprecation warning). Beginning with Home Assistant Core 2025.12 the deprecation period ends, self.config_entry becomes truly read-only and attempting to assign to it raises an AttributeError (which produces the 500 error shown in the UI).

What I changed:

  • Store the passed ConfigEntry in a private attribute instead:
    • self._config_entry = config_entry
  • Use self._config_entry.options.get(...) to populate option defaults in the options schema.
  • Corrected the type hint in async_get_options_flow to accept a ConfigEntry.

Tested:

  • Restarted Home Assistant and verified the Options (Configure) form opens without the AttributeError / 500 error.
  • Verified option defaults load correctly from the stored config entry, And that changes are saved and loaded correctly.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant