forked from pmpkk/openhab_spotify-webconnect-api
-
Notifications
You must be signed in to change notification settings - Fork 2
/
SpotifySettings.widget.json
3 lines (3 loc) · 4.12 KB
/
SpotifySettings.widget.json
1
2
3
{
"template": "<div class=\"section\" ng-init=\"new_client_id='id';new_client_secret='secret'}};serverURL='http://Debra.local:8080/static/spotify-auth.html'\">\n <widget style=\"font-size: 25px;\">\n <div class=\"title\">Set up spotify client id and secret</div>\n <div class=\"name\"> Follow instructions on github in particular add spotify-auth.html to openhab-conf/html/ </div>\n <div class=\"name\"> Sign up to spotify to develop your own app to get a client ID and client secret <a href=\"https://developers.spotify.com/my-application/\">developers.spotify.com/my-application/</a> Don't forget to add http://openhabian:8080/static/spotify-auth.html (modify for your version) to the redirect uri and save changes. Complete id and secret below and click buttons to update them. then click authenticate link and authenticate</div>\n\n <div class=\"name\">Current ID: {{itemValue('spotify_client_id')}} </div> <div class=\"name\"> Enter new spotify_client_id <input style=\"color: black;\" ng-model=\"new_client_id\" size=\"35\" />\n <button style=\"background-color: #e7e7e7; color: black;\" ng-click=\"sendCmd('spotify_client_id', new_client_id)\">Update Client ID</button></div>\n <div class=\"name\">Current secret: {{itemValue('spotify_client_secret')}}</div> <div class=\"name\"> Enter new spotify_client_secret <input style=\"color: black;\" ng-model=\"new_client_secret\" size=\"35\" />\n <button style=\"background-color: #e7e7e7; color: black;\" ng-click=\"sendCmd('spotify_client_secret', new_client_secret)\" style=\"color=back\">Update Client Secret</button></div>\n \n <div class=\"name\"> Now you have set up your spotify client id {{itemValue('spotify_client_id')}} and secret {{itemValue('spotify_client_secret')}} you have to authorise with spotify the following link will open http://openhabian:8080/static/spotify-auth.html or equiv to begin authorisation </div>\n <button style=\"background-color: #e7e7e7; color: red;\"><div class=\"title\"> <a href=/static/spotify-auth.html target=\"_blank\" >Open authenication link!</a></div></button>\n <div class=\"controlGroup\">\n <div class=\"heading\"> Blow clears other creds credential- DANGEROUS</div>\n <button ><div class=\"name\" ng-init=\"display=0\" style=\"color: red;\">Click below to see and reset auth codes</div></button>\n <div class=\"name\" ng-click=\"display=1\" style=\"color: red;\">ENABLE RESET - DANGER</div>\n <div class=\"nameGroup\" ng-if=\"display==1\">\n <button style=\"background-color: #e7e7e7; color: red;\" ng-click=\"sendCmd('spotify_auth_code','NULL')\">Reset</button><div> {{itemValue('spotify_auth_code')}}</div>\n <button style=\"background-color: #e7e7e7; color: red;\" ng-click=\"sendCmd('spotify_access_token','NULL')\">Reset</button><div> {{itemValue('spotify_access_token')}}</div>\n <button style=\"background-color: #e7e7e7; color: red;\" ng-click=\"sendCmd('spotify_refresh_token','NULL')\">Reset</button><div> {{itemValue('spotify_refresh_token')}}</div>\n <button style=\"background-color: #e7e7e7; color: red;\" ng-click=\"sendCmd('spotify_token_expiry','NULL')\">Reset</button><div> {{itemValue('spotify_token_expiry')}}</div>\n </div>\n </div>\n </widget>\n</div>\n\n<div class=\"section\" ng-init=\"new_value='value';new_name='item';\">\n <widget style=\"font-size: 20px; color: white;\" >\n <header>Set Value of anything</header>\n <div class=\"name\">Simply write the openhab variable in the Item Name Column to see it's value. You can then set/change it's value</div>\n <div class=\"name\" style=\"color: black;\">Item Name:</div><input style=\"color: black;\" size=\"35\" ng-model=\"new_name\" />\n <div class=\"name\"> Item Value is {{ itemValue(new_name) }}</div>\n <div class=\"name\" style=\"color: black;\">Item Value:</div><input style=\"color: black;\" ng-model=\"new_value\" size=\"35\" />\n <button ng-click=\"sendCmd(new_name, new_value)\" style=\"color: black;\">Click Here to set/update item </button><div>Set {{new_name}} to {{ new_value }}</div>\n <div class=\"name\"> Item Value is {{ itemValue(new_name) }}</div>\n </widget>\n</div>\n"
}