home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.29k stars 30.61k forks source link

Make spotify update interval dynamic #129642

Open joostlek opened 15 hours ago

joostlek commented 15 hours ago

Proposed change

Make spotify update interval dynamic, since we know when a track is expected to end, so if we schedule our update just after the track has ended, we can be more accurate

Type of change

Additional information

Checklist

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

To help with the load of incoming pull requests:

home-assistant[bot] commented 15 hours ago

Hey there @frenck, mind taking a look at this pull request as it has been labeled with an integration (spotify) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `spotify` can trigger bot actions by commenting: - `@home-assistant close` Closes the pull request. - `@home-assistant rename Awesome new title` Renames the pull request. - `@home-assistant reopen` Reopen the pull request. - `@home-assistant unassign spotify` Removes the current integration label and assignees on the pull request, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.
luca-angemi commented 14 hours ago

What happens if you skip to the next song?

joostlek commented 14 hours ago

If you skip a song it will just have the regular interval. I'd rather make it like this than set the update interval lower. With this logic we would at least refresh at a moment we know when there is new data