Toggle Power State
JGKarlin opened this issue · 8 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
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.
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 do you have a link to the PR?
ok so it wasn't just me , have exact same issue :)
This is the pullrequest home-assistant/core#78192
There was some initial confusion which I think I clarified, but been silent after that.
Any plan to solve this?
@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 :(
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.