diff --git a/lifx_control_panel/_constants.py b/lifx_control_panel/_constants.py index 61d1092..66c0016 100644 --- a/lifx_control_panel/_constants.py +++ b/lifx_control_panel/_constants.py @@ -1,4 +1,4 @@ VERSION = "2.3.0" -BUILD_DATE = "2022-06-24T06:40:37.641096" +BUILD_DATE = "2022-12-12T06:22:59.747968" AUTHOR = "Sawyer McLane" DEBUGGING = False diff --git a/lifx_control_panel/frames.py b/lifx_control_panel/frames.py index ebe69ca..8870962 100644 --- a/lifx_control_panel/frames.py +++ b/lifx_control_panel/frames.py @@ -607,7 +607,11 @@ def update_status_from_bulb(self, run_once=False): run_once - Don't call `after` statement at end. Keeps a million workers from being instanced. """ require_icon_update = False - if not self.master.bulb_interface.power_queue[self.label].empty(): + power_queue = self.master.bulb_interface.power_queue + if ( + self.label in power_queue + and not self.master.bulb_interface.power_queue[self.label].empty() + ): power = self.master.bulb_interface.power_queue[self.label].get() require_icon_update = True self.tk_power_var.set(power) @@ -619,7 +623,11 @@ def update_status_from_bulb(self, run_once=False): self.option_on.select() self.option_off.selection_clear() - if not self.master.bulb_interface.color_queue[self.label].empty(): + color_queue = self.master.bulb_interface.color_queue + if ( + self.label in color_queue + and not self.master.bulb_interface.color_queue[self.label].empty() + ): hsbk = self.master.bulb_interface.color_queue[self.label].get() require_icon_update = True for key, _ in enumerate(self.hsbk): diff --git a/lifx_control_panel/utilities/color_thread.py b/lifx_control_panel/utilities/color_thread.py index 35519b9..c7228cb 100644 --- a/lifx_control_panel/utilities/color_thread.py +++ b/lifx_control_panel/utilities/color_thread.py @@ -76,10 +76,10 @@ def __init__(self): self.pos = 0 self.cycle_color = hsv_to_rgb(self.pos, 1, 1) - def get_color(self): + def get_color(self, *args, **kwargs): if time.time() - self.last_change > 0.1: self.pos = (self.pos + 1) % 360 - self.cycle_color = hsv_to_rgb(self.pos, 1, 1) + self.cycle_color = hsv_to_rgb(self.pos, 1, self.initial_color[2] / 65535) self.last_change = time.time() return list( utils.RGBtoHSBK(self.cycle_color, temperature=self.initial_color[3])