diff --git a/server.py b/server.py index e5ff622..b03fb04 100755 --- a/server.py +++ b/server.py @@ -1674,6 +1674,28 @@ def saveSchedulerSettings(): try: with open('csv/scheduler.json','r') as f: scheduler_settings = json.load(f) + if 'screensaver' not in str(scheduler_settings): + scheduler_settings['screensaver1'] = {} + scheduler_settings['screensaver1']['hour'] = '00' + scheduler_settings['screensaver1']['minute'] = '00' + scheduler_settings['screensaver1']['endhour'] = '00' + scheduler_settings['screensaver1']['endminute'] = '00' + scheduler_settings['screensaver1']['type'] = 'World Clock' + scheduler_settings['screensaver1']['enabled'] = False + scheduler_settings['screensaver2'] = {} + scheduler_settings['screensaver2']['hour'] = '00' + scheduler_settings['screensaver2']['minute'] = '00' + scheduler_settings['screensaver2']['endhour'] = '00' + scheduler_settings['screensaver2']['endminute'] = '00' + scheduler_settings['screensaver2']['type'] = 'Clock 2' + scheduler_settings['screensaver2']['enabled'] = False + scheduler_settings['screensaver3'] = {} + scheduler_settings['screensaver3']['hour'] = '00' + scheduler_settings['screensaver3']['minute'] = '00' + scheduler_settings['screensaver3']['endhour'] = '00' + scheduler_settings['screensaver3']['endminute'] = '00' + scheduler_settings['screensaver3']['type'] = 'Clock 1' + scheduler_settings['screensaver3']['enabled'] = False except: scheduler_settings = {"shutdown": {"hour": "00", "minute": "00", "enabled": False}, "reboot":{"hour": "00", "minute": "00", "enabled": False}, "timezone": "GMT", "brightness1":{"hour": "00", "minute": "00", "bright": "10", "enabled": False}, "brightness2":{"hour": "00", "minute": "00", "bright": "10", "enabled": False}, "brightness3":{"hour": "00", "minute": "00", "bright": "10", "enabled": False}, "brightness4":{"hour": "00", "minute": "00", "bright": "10", "enabled": False}, "screensaver1":{"hour": "00", "minute": "00", "endhour": "00", "endminute": "00", "type":"World Clock", "enabled": False}, "screensaver2":{"hour": "00", "minute": "00", "endhour": "00", "endminute": "00", "type":"Clock 1", "enabled": False}, "screensaver3":{"hour": "00", "minute": "00", "endhour": "00", "endminute": "00", "type":"Clock 2", "enabled": False}}