Pouzor / freebox_player

Custom Component for Home Assistant, enable to remote Freebox Player
18 stars 7 forks source link

Player status #13

Open JohannCR opened 3 years ago

JohannCR commented 3 years ago

Hi !

Awesome, works very well. You deserve a thank you ! ^^ Two suggestions :

Cheers and thanks again

JohannCR commented 3 years ago

Also the code "back" for the back button doesn't seem to work... Is anyone else experiencing it too ?

Is there any way to pause for a second between commands ? Thanks !

JohannCR commented 3 years ago

It appears some buttons work differently than those of the remote. For example :

JohannCR commented 3 years ago

Also, about the question of pausing between commands (got some weird behaviour when biulding long multiple commands) I found a solution by editing the init file that I thought worth sharing if someone needs it:

`async def async_freebox_player_remote(call):
        """Handle old player control (remote emulation)"""
        code_list = call.data.get('code')
        code_array = code_list.split(',')
        """Handle multiple codes, separated by comma"""
        for code in code_array:
            if code == ".":
                time.sleep(1)
            elif code != 'slow': 
                requests.get(player_path+code, verify=False)
                if code_array[0] == 'slow':
                    time.sleep(0.5)`

I use "." as a command to pause for a second at one point, and the command "slow" as first command in a list in order to pause systematically half a second between each code. I'm open to suggestions if there is a better way to do it ^^

totoantibes commented 3 years ago

getting a sensor on status would really help build automations....

Pouzor commented 3 years ago

Hi I'm getting back on this, thx for the review, I'm gonna check how I can get info about status of the player.

zobi commented 1 year ago

Hello, thanks for this it work's well ;) I'm very interested to get the status of the player too ;)