fetchIP
E. Almqvist 4 years ago
parent cc963ef57c
commit 57f6fa55ea
  1. 11
      hue_controller.py
  2. 3
      hue_remote.py

@ -126,11 +126,14 @@ class controller:
print("Error: Light index '" + str(index) + "' out of range")
def setPreset( presetID:str, index:int=-1 ):
if( index == -1 ):
for key in LIGHTS:
controller.setLightPreset( key, presetID )
if( PRESETS.get(presetID) ):
if( index == -1 ):
for key in LIGHTS:
controller.setLightPreset( key, presetID )
else:
controller.setLightPreset( index, presetID )
else:
controller.setLightPreset( index, presetID )
print("Error: Unknown preset '" + presetID + "'")
def countLights():
return len(LIGHTS)

@ -81,8 +81,9 @@ def parseCommand( cmd:list, pos:int, i=-1 ):
return
help() # display help if function did nothing
except (RuntimeError, TypeError, NameError, IndexError):
except (RuntimeError, TypeError, NameError, IndexError) as err:
help() # display the help page if parameters are missing (it will give out an IndexError)
print( "\n\nError: " + str(err) )
def parseCommandline():

Loading…
Cancel
Save