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

State not updated when pausing playback #11

Closed
lociii opened this Issue Oct 4, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@lociii

lociii commented Oct 4, 2018

Thanks for the native implementation.
Works great in general, just found one "issue" (maybe it's just a limitation).

Whenever I pause the playback, the state of the fire tv is still "playing".
Would be great if the state updates to "paused" so that automations aren't accidentally resuming playback.
e.g. I'd love to stop playback on an incoming call.

Can you reproduce or let me know if it's a limitation?
Thanks.

@JeffLIrion

This comment has been minimized.

Show comment
Hide comment
@JeffLIrion

JeffLIrion Oct 4, 2018

Owner

That's just a limitation. In the update function it determines whether it's playing, paused, or on standby based on the current app and whether or not wake lock is in effect

else:
# Get the running apps.
self._running_apps = self._firetv.running_apps()
# Get the current app.
current_app = self._firetv.current_app
if isinstance(current_app, dict) and 'package' in current_app:
self._current_app = current_app['package']
else:
self._current_app = current_app
# Check if the launcher is active.
if self._current_app in [PACKAGE_LAUNCHER, PACKAGE_SETTINGS]:
self._state = STATE_STANDBY
# Check for a wake lock (device is playing).
elif self._firetv._wake_lock:
self._state = STATE_PLAYING
# Otherwise, device is paused.
else:
self._state = STATE_PAUSED

Owner

JeffLIrion commented Oct 4, 2018

That's just a limitation. In the update function it determines whether it's playing, paused, or on standby based on the current app and whether or not wake lock is in effect

else:
# Get the running apps.
self._running_apps = self._firetv.running_apps()
# Get the current app.
current_app = self._firetv.current_app
if isinstance(current_app, dict) and 'package' in current_app:
self._current_app = current_app['package']
else:
self._current_app = current_app
# Check if the launcher is active.
if self._current_app in [PACKAGE_LAUNCHER, PACKAGE_SETTINGS]:
self._state = STATE_STANDBY
# Check for a wake lock (device is playing).
elif self._firetv._wake_lock:
self._state = STATE_PLAYING
# Otherwise, device is paused.
else:
self._state = STATE_PAUSED

@JeffLIrion JeffLIrion closed this Oct 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment