-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
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
spotify media player #6980
spotify media player #6980
Conversation
@happyleavesaoc, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob, @fabaff and @robbiet480 to be potential reviewers. |
import spotipy.oauth2 | ||
token_refreshed = False | ||
need_token = (self._token_info is None or | ||
spotipy.oauth2.is_token_expired(self._token_info)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continuation line under-indented for visual indent
self._state = STATE_PLAYING | ||
device = current.get('device') | ||
if device is None: | ||
self._state = STATE_IDLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined name 'STATE_IDLE'
self.refresh_spotify_instance() | ||
current = self._player.current_playback() | ||
if current is None: | ||
self._state = STATE_IDLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined name 'STATE_IDLE'
A few users have tested this and confirmed it works. Ready to merge! |
This worked for me, although the redirect caused a file download in my browser. I believe it's because Spotify expects to POST back to Other than that very small note, everything seems to work! |
@robbiet480 |
Sorry for taking so long to review. I've been busy. I removed the calls to This looks good 🐬 |
Hello, I tried using this media player, but I get the following error : File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/media_player/spotify.py", line 156, in update |
@pbros Make sure you've installed the correct version of |
Description:
Spotify recently opened up their "Connect" playback web api: https://developer.spotify.com/web-api/web-api-connect-endpoint-reference/
Now we can have a Spotify media player with standard playback controls, track metadata, etc. Also can switch devices (implemented via
source_select
).Pending spotipy-dev/spotipy#182 on the
spotipy
library; temporarily depending on my fork.Requirements:
http://<your_url>/api/spotify
I hope someone else can test this before it is merged.
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#2406
Example entry for
configuration.yaml
(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable ([example][ex-requir]).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard.py#L54