Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Never get the stats ‘’off’’ #5

Open
MattL0 opened this issue Feb 9, 2019 · 2 comments
Open

Never get the stats ‘’off’’ #5

MattL0 opened this issue Feb 9, 2019 · 2 comments

Comments

@MattL0
Copy link

MattL0 commented Feb 9, 2019

I mean,

When I close mpc-hc . I mever get an updated state. The state stays at the last knows value before i close the program.

If i chek the code here, it is supposed to send a off if there is no info available?

And the else should be stopped.

You can also get the 0,1,2 value from the web page .

So ... if 0 return STATE_STOPPED
If 1 return STATE_PAUSED
If 2 return STATE_PLAYING
Else return STATE_OFF

———-
@Property
def state(self):
"""Return the state of the device."""
state = self._player_variables.get('statestring', None)

    if state is None:
        return STATE_OFF
    if state == 'playing':
        return STATE_PLAYING
    elif state == 'paused':
        return STATE_PAUSED
    else:
        return STATE_IDLE
@MattL0
Copy link
Author

MattL0 commented Feb 9, 2019

http://IP_ADRESS:13579/variables.html

@MattL0
Copy link
Author

MattL0 commented Feb 11, 2019

that webpage is not available when mpchc is off. So that's the hard part. Is there way this addon could ping the /variables.html ? And if there i nothing, set the state to off ?

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant