Esempio n. 1
0
# Let the display know the URL to use
display.setConfigPage('http://%s:%d/' % (settings.get('local-ip'), 7777))

# Prep random
random.seed(long(time.clock()))
colormatch = colormatch(settings.get('colortemp-script'),
                        2700)  # 2700K = Soft white, lowest we'll go
slideshow = slideshow(display, settings, colormatch)
timekeeper = timekeeper(display.enable, slideshow.start)
slideshow.setQueryPower(timekeeper.getDisplayOn)
slideshow.setServiceManager(services)

timekeeper.setConfiguration(settings.getUser('display-on'),
                            settings.getUser('display-off'))
timekeeper.setAmbientSensitivity(settings.getUser('autooff-lux'),
                                 settings.getUser('autooff-time'))
timekeeper.setPowermode(settings.getUser('powersave'))
colormatch.setUpdateListener(timekeeper.sensorListener)

powermanagement = shutdown(settings.getUser('shutdown-pin'))

if __name__ == "__main__":
    # This allows us to use a plain HTTP callback
    os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'
    app.secret_key = os.urandom(24)
    slideshow.start()
    app.run(debug=False, port=cmdline.port, host=cmdline.listen)

sys.exit(0)
Esempio n. 2
0
def complete():
    slideshow.start(True)
    return redirect('/')