def oauthSetToken(token): settings.set('oauth_token', token)
width, height, tvservice = display.setConfiguration( settings.getUser('tvservice'), settings.getUser('display-special')) settings.setUser('tvservice', tvservice) settings.setUser('width', width) settings.setUser('height', height) settings.save() # Force display to desired user setting display.enable(True, True) # Load services services = ServiceManager(settings) # Spin until we have internet, check every 10s while True: settings.set('local-ip', helper.getIP()) if settings.get('local-ip') is None: logging.error( 'You must have functional internet connection to use this app') display.message('No internet\n\nCheck wifi-config.txt or cable') time.sleep(10) else: break # 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'),
def cfg_reset(): settings.userDefaults() settings.set('oauth_token', None) saveSettings() return jsonify({'reset': True})