huesyncbox icon indicating copy to clipboard operation
huesyncbox copied to clipboard

Toggle Power State

Open JGKarlin opened this issue 3 years ago • 2 comments

Describe the bug media_player.toggle service call only turns on but not off.

Expected behavior media_player.toggle should toggle between power states.

Environment Docker

  • Home Assistant Core version: 2022.08.06
  • Huesyncbox integration version: v1.22.0

JGKarlin avatar Aug 24 '22 08:08 JGKarlin

Hmm, indeed. That does not work.

It seems to be because I set the state to "idle" when the syncbox is on, but not syncing. The Toggle code in Homae Assistant then thinks the box is Off and tries to turn in On again, which results in the syncbox staying on.

I will have to check with the HA developers to see if I am using the wrong state or that the toggle code in HA is wrong. It seems like other official integrations like for example Cast have the same issue.

mvdwetering avatar Aug 24 '22 19:08 mvdwetering

FYI I submitted a pullrequest to fix this in Home Assistant a while ago, but it takes a while for pullrequests to get processed, so lets see when it gets in.

mvdwetering avatar Oct 16 '22 13:10 mvdwetering

@mvdwetering do you have a link to the PR?

johntdyer avatar Nov 07 '22 15:11 johntdyer

ok so it wasn't just me , have exact same issue :)

Ex-28 avatar Nov 09 '22 13:11 Ex-28

This is the pullrequest https://github.com/home-assistant/core/pull/78192 There was some initial confusion which I think I clarified, but been silent after that.

mvdwetering avatar Nov 09 '22 19:11 mvdwetering

Any plan to solve this?

Claudio1L avatar Nov 19 '22 09:11 Claudio1L

@Claudio1L I have a pullrequest with a fix for Home Assistant as mentioned in my previous post. It just waits for further processing there. Unfortunately that sometimes can take a long time :(

mvdwetering avatar Nov 19 '22 12:11 mvdwetering

In the end I gave up on the Pull Request with Home Assistant, I did not know how to get it further. So the bug still exists in the mediaplayer entity.

However I just released v2.0.0 of this integration which does not use the mediaplayer entity anymore, so that kind of "solves" the problem for this integration. Power is now controlled by a normal switch entity and toggle works on that.

mvdwetering avatar Aug 30 '23 18:08 mvdwetering