Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def set_color(self, curr_balance):
hue = self.calculate_color(curr_balance)
if not len(self.light_ids):
self.light_ids = list(self.bridge.lights().keys())
for _id in self.light_ids:
try:
self.bridge.lights[int(_id)].state(hue=hue)
except QhueException as e:
LOGGER.warning(e)