Skip to content

Instantly share code, notes, and snippets.

@erinxocon
Last active September 1, 2018 00:12
Show Gist options
  • Save erinxocon/d3ad9e896ddb75d1dcc39225bb4dc710 to your computer and use it in GitHub Desktop.
Save erinxocon/d3ad9e896ddb75d1dcc39225bb4dc710 to your computer and use it in GitHub Desktop.
from flask import Flask, render_template, jsonify, redirect
from soco import SoCo
import json
app = Flask(__name__)
sonos = SoCo('10.0.1.153')
@app.route("/info")
def info():
track = sonos.get_current_track_info()
return render_template('index.html', art=track['album_art'])
if __name__ == '__main__':
app.run(debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment