Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def change_light_state(bridge, light, state):
for key in NON_MODIFIABLE_STATES:
if key in state:
del state[key]
try:
bridge.lights[light].state(**state)
except QhueException as exception:
stderr(f'Exception occurred while controlling light #{light}: {exception}')