ericmatte/ad-media-lights-sync

Trigger immediately when the switch is on

Opened this issue · 1 comments

Is your feature request related to a problem? Please describe.

It would be nice if you didn't have to wait for the next track for the colours to be applied.

Describe the solution you'd like

I added a listener to the input boolean for controlling light sync, but I don't know if this would work for those not adding the override switch in place.

Describe alternatives you've considered

Sorry, none so far!

Additional context

Here's my code for this.

                if self.condition["entity"] is not None:
                    self.listen_state(self.start_now, self.condition["entity"])

    def start_now(self, entity, attribute, old, new, kwargs):
        if new == "on":
            media_players = self.args["media_player"] if isinstance(self.args["media_player"], list) else [self.args["media_player"]]
            for media_player in media_players:
                for photo_attribute in PICTURE_ATTRIBUTES:
                    self.change_lights_color(media_player, photo_attribute, "", self.get_state(media_player, photo_attribute), kwargs);

Hi,

It would be nice if you didn't have to wait for the next track for the colours to be applied.

Do you use a spotify media_player for this? It also happens to me, but only with Spotify.


I like you idea! If you would like to contribute and make a pull request, I could review the change :)

I'm just wondering if we should make this optional using a flag setting 🤔 Can you think of any drawbacks to this?

Cheers