Skip to content

Conversation

@ludeeus
Copy link
Member

@ludeeus ludeeus commented Dec 2, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 2, 2025 20:42
@ludeeus ludeeus added the enhancement New feature or request label Dec 2, 2025
Copilot finished reviewing on behalf of ludeeus December 2, 2025 20:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds event publishing for login and logout operations in the Cloud class, enabling external components to subscribe to and react to authentication state changes.

  • Adds LOGIN and LOGOUT event types to the CloudEventType enum
  • Publishes LOGIN events after successful login() and login_verify_totp() calls
  • Publishes a LOGOUT event at the start of the logout() method
  • Refactors CloudEvent base class to make type a required instance field, allowing direct instantiation with specific event types
  • Updates existing event subclasses (RelayerConnectedEvent, RelayerDisconnectedEvent) to use field(init=False) for the type field

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
hass_nabucasa/events/types.py Adds LOGIN and LOGOUT event types; refactors CloudEvent to make type a required instance field; updates RelayerConnectedEvent and RelayerDisconnectedEvent to use field(init=False) for type
hass_nabucasa/init.py Adds event publishing in login(), login_verify_totp(), and logout() methods
tests/events/snapshots/test_bus.ambr Updates snapshot to reflect new field ordering in dataclass repr (type before timestamp)

Copy link
Member

@klejejs klejejs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@ludeeus ludeeus merged commit eabb5af into main Dec 6, 2025
4 checks passed
@ludeeus ludeeus deleted the loginlogoutevents branch December 6, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants