Error message

master
E. Almqvist 4 years ago
parent 4b50fe5554
commit e12ef3c903
  1. 4
      modules/hue/hue_controller.py
  2. 4
      setup.sh

@ -178,9 +178,13 @@ class controller:
else: else:
BRIDGE_ADDRESS = APIrequest.fetchBridgeIP() BRIDGE_ADDRESS = APIrequest.fetchBridgeIP()
try:
jsonLights = loop.run_until_complete(APIrequest.get("/lights")) jsonLights = loop.run_until_complete(APIrequest.get("/lights"))
global LIGHTS global LIGHTS
LIGHTS = json.loads(jsonLights.text) LIGHTS = json.loads(jsonLights.text)
except Exception as err:
print("\033[91mUnable to fetch lights. This could be because your configuration file is incomplete! Please check your config at \"~/.config/roomcomputer/config.json\".\033[0m")
raise err
def end(): def end():
loop.close() loop.close()

@ -2,6 +2,10 @@
cfgPath="$HOME/.config/roomcomputer" cfgPath="$HOME/.config/roomcomputer"
if [ -d $cfgPath ]; then
echo Config already exists.
else
mkdir $cfgPath mkdir $cfgPath
cp default-config.json $cfgPath/config.json cp default-config.json $cfgPath/config.json
cp default-presets.json $cfgPath/presets.json cp default-presets.json $cfgPath/presets.json
fi

Loading…
Cancel
Save