@ -178,9 +178,13 @@ class controller:
else:
BRIDGE_ADDRESS = APIrequest.fetchBridgeIP()
try:
jsonLights = loop.run_until_complete(APIrequest.get("/lights"))
global LIGHTS
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():
loop.close()
@ -2,6 +2,10 @@
cfgPath="$HOME/.config/roomcomputer"
mkdir $cfgPath
cp default-config.json $cfgPath/config.json
cp default-presets.json $cfgPath/presets.json
if [ -d $cfgPath ]; then
echo Config already exists.
else
fi