house-of-abbey / GarminHomeAssistant

Garmin application to provide a dashboard to control your Home Assistant
https://community.home-assistant.io/t/home-assistant-app-for-garmin/637348
MIT License
70 stars 12 forks source link

Activity Completed Background Update #149

Closed JosephAbbey closed 4 weeks ago

JosephAbbey commented 1 month ago

Aside from temporal events, the only useful trigger for background services is activity completion (https://developer.garmin.com/connect-iq/api-docs/Toybox/Background.html#registerForActivityCompletedEvent-instance_method).

Updating the states instantly on completion would allow for better automations:

We should be able to use the same callback that is already implemented for temporal events.

philipabbey commented 4 weeks ago

https://developer.garmin.com/connect-iq/api-docs/Toybox/System/ServiceDelegate.html#onActivityCompleted-instance_function

Have onActivityCompleted() call onTemporalEvent()?