willholdoway / hifiberry

This is a custom component to allow control of HifiberryOS devices in Home Assistant using the audiocontrol2 REST API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support turn_on/off_action

TheGroundZero opened this issue · comments

Hi

I noticed that while media_player.pause works to stop playing music from the Radio source on my HiFiBerry, media_player.start doesn't restart the stream.
Therefore, I want to use media_player.volume_mute (true/false) instead via the turn_on_action and turn_off_action most mediaplayers usually support.

However, it seems that this integration doesn't support these options.
Invalid config for [media_player.hifiberry]: [turn_on_action] is an invalid option for [media_player.hifiberry]. Check: media_player.hifiberry->turn_on_action. (See ?, line ?).

Would you (or someone else) be willing to add support for these options to this integration?

Kr
TGZ

Hi TGZ, why would you want to do this rather than just use mute/unmute? Given it's not an additional feature and is just a remap I would suggest maybe you do this by means of a universal media player?

Hi @willholdoway

It's easier if the entity can be configured using turn_on_action and turn_off_action instead of having to manually set tap_action etc to call the service.

Currently, stopping and restarting the played media (at least the radio stream) doesn't work as I'd expect to.
If I click the entity (status-icon in picture-elements card) I can stop the stream, but not restart it.
That's not how one would expect to control a mediaplayer from the HA dashboard.

So one would either expect to either "fix" it using turn_on_action and turn_off_action or the integration being able to do so.

Hi @TheGroundZero I don't understand your Lovelace setup with this unfortunately. Mute and unmute is not starting and stopping a media stream so I'm not happy to integrate a non-feature like that. As I mentioned before, remapping a function like this can be very easily achieved with a universal media player