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.
In #407 and skodaconnect/homeassistant-myskoda#737 we started reworking how MQTT events are handled, but only did it for charging events:
MySkodanow owns the callback subscriptions and 'intercepts' the events so it can perform processing before proxying the events to the subscribed callbacksMySkodaitselfMySkoda.vehicle()The same approach can be implemented for all other events.
Most likely requires implementing a debounce mechanism within
MySkodafor 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)