Skip to content

Finish MQTT event handling rework #409

Description

@dvx76

In #407 and skodaconnect/homeassistant-myskoda#737 we started reworking how MQTT events are handled, but only did it for charging events:

  • MySkoda now owns the callback subscriptions and 'intercepts' the events so it can perform processing before proxying the events to the subscribed callbacks
  • Refresh API responses as required + update cached Vehicle with data from Event. All within MySkoda itself
  • Client (coordinator in integration) upon receiving a charging event just needs to refresh the Vehicle using MySkoda.vehicle()

The same approach can be implemented for all other events.

Most likely requires implementing a debounce mechanism within MySkoda for querying the API endpoints since events all access events can happen quickly. Actually having a debounce on handling the event itself might be even better. This could also deduplicate the events being proxied back to the MySkoda client...

Also from skodaconnect/homeassistant-myskoda#737 (comment)

We design a place for the client to know about what actually happened inside MySkoda while it was doing this unannounced update. Did we hit an API limit? Did the Internet connection break? Or was all fine. I don't think this is in this PR-set, but could be a follow-up.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions