Closed benknight closed 3 years ago
Unfortunately not, here is the error:
Traceback (most recent call last):
File "logic/packages/workflow/workflow.py", line 2073, in run
func(self)
File "/Users/dpasdar/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.EB0F350D-07DF-4543-B8B5-43898306C9DE/logic/filters.py", line 458, in main
items = hue_index_filter.get_items()
File "/Users/dpasdar/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.EB0F350D-07DF-4543-B8B5-43898306C9DE/logic/filters.py", line 102, in get_items
lights = utils.get_lights()
File "logic/utils.py", line 85, in get_lights
load_full_state()
File "logic/utils.py", line 47, in load_full_state
create_light_icon(lid, light_data)
File "logic/utils.py", line 66, in create_light_icon
rgb_value = (255, 255, 255) if light_data['state']['on'] else (0, 0, 0)
KeyError: u'on'
Changing that line to
rgb_value = (255, 255, 255) if 'on' in light_data['state'] and light_data['state']['on'] else (0, 0, 0)
solved the problem.
@dpasdar I've pushed a fix for the error you pasted, can you check one more time and see if the code runs successfully now? Thanks for your patience.
It works now! Thanks a lot.
@dpasdar I think this approach is a bit simpler. Just filter out anything that doesn't look like a light. Can you check if this works?