Skip to content

Commit

Permalink
Release 2.3 with fix for new token
Browse files Browse the repository at this point in the history
  • Loading branch information
fondberg committed Oct 6, 2019
1 parent 26f9da1 commit 70a587a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Buy me a coffee](https://img.shields.io/static/v1.svg?label=Buy%20me%20a%20coffee&message=🥨&color=black&logo=buy%20me%20a%20coffee&logoColor=white&labelColor=6f4e37)](https://www.buymeacoffee.com/fondberg)

# Spotcast
# Spotcast
Home Assistant custom component to start Spotify playback on an idle chromecast device

This component is not meant to be a full Spotify chromecast media_player but only serves to start the playback. Controlling the chromcast device and the Spotify playback after the initial start is done in their respective components.
Expand All @@ -12,11 +12,12 @@ Used by https://github.com/custom-cards/spotify-card.

Community post: https://community.home-assistant.io/t/spotcast-custom-component-to-start-playback-on-an-idle-chromecast-device/114232

_Now with support for speaker groups, transferring playback to and between chromecast devices and using HA entity id instead of device_name_.
_Now with support for speaker groups, transferring playback to and between chromecast devices and using HA entity id instead of device_name_.

***Important***
Release 2.2 Uses a quick fix for getting the spotify webplayer token.
Release 2.1 requires Home Assistant 0.99 due to update in pychromecast version.
As of release 2 the sensor is optional. To add it add it to the configs sensor section.
As of release 2 the sensor is optional. To add it add it to the configs sensor section.

## Installation

Expand All @@ -34,7 +35,7 @@ spotcast:
password: !secret spotify_password
```
#### Multiple accounts
Add `accounts` dict to the configuration and populate with a list of accounts to
Add `accounts` dict to the configuration and populate with a list of accounts to
be able to initiate playback using diffferent accounts than the default.
```
Expand All @@ -60,7 +61,7 @@ spotcast:
"random_song": true
}
```
where
where
- `device_name` is the friendly name of the Chromecast
- `uri` is the spotify uri, supports all uris including track (limit to one track)
- `random_song` optional parameter that starts the playback at a random position in the playlist
Expand Down Expand Up @@ -88,7 +89,7 @@ or use the parameter `transfer_playback` which will only transfer if something i
"transfer_playback" : true
}
```
where
where
- `device_name` is the friendly name of the Chromecast
- `transfer_playback` (optional) true or false, continue ongoing playback on your Chromecast

Expand All @@ -101,7 +102,7 @@ where
"uri" : "spotify:playlist:37i9dQZF1DX3yvAYDslnv8"
}
```
where
where
- `account` is the name of account key in the accounts dictionary in the configuration
- `device_name` is the friendly name of the Chromecast
- `uri` is the spotify uri, supports all uris including track (limit to one track)
Expand All @@ -110,7 +111,7 @@ where
The sensor has the discovered chromecasts as both json and since v.2.1 as an array of objects.
Add the following to the sensor section of the configuration:
```
sensor:
sensor:
- platform: spotcast
```

Expand All @@ -128,17 +129,17 @@ friendly_name: Chromecast Devices
```



## Known issues
It has been reported that updating the sensor takes more than 10s sometimes.
It has been reported that updating the sensor takes more than 10s sometimes.

## Donate
If you like what I do and want to support me then I love coffee

<a href="https://www.buymeacoffee.com/fondberg" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>

## Contribute
Please do

## License
Apache 2.0
2 changes: 2 additions & 0 deletions custom_components/spotcast/spotify_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
Retrieves a web player access_token from Spotify
Written by Alex Ladd http://github.com/AlexLadd
Original Code from spotify_token: https://github.com/enriquegh/spotify-webplayer-token
License: MIT https://github.com/enriquegh/spotify-webplayer-token/blob/master/LICENSE
Contributors:
Daniel Lashua http://github.com/dlashua
Expand Down

0 comments on commit 70a587a

Please sign in to comment.