diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 5a1447ce..72829fcb 100644 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -1588,27 +1588,34 @@ async def update_hue_run(self, service_data: ServiceData): return _LOGGER.debug( - "%s: Will updates scenes containing %s", - self._name, - self.hue_keyword, + "%s: Will updates scenes containing %s", + self._name, + self.hue_keyword, ) await self.hue_bridge.initialize() for scene_id in self.hue_bridge.scenes: scene = self.hue_bridge.scenes[scene_id] if self.hue_keyword in scene.name: - color_temp = color_temperature_kelvin_to_mired(service_data[ATTR_COLOR_TEMP_KELVIN]) + color_temp = color_temperature_kelvin_to_mired( + service_data[ATTR_COLOR_TEMP_KELVIN] + ) brightness = round(254 * self._settings["brightness_pct"] / 100) _LOGGER.debug( "%s: Updating %s with values bri:%s, color_temp:%s", self._name, scene.name, brightness, - color_temp + color_temp, ) lightstates = await scene.lightstates for light_id in scene.lights: try: - await scene.set_lightstate(id=light_id,on=lightstates[light_id]["on"],bri=brightness,ct=color_temp) + await scene.set_lightstate( + id=light_id, + on=lightstates[light_id]["on"], + bri=brightness, + ct=color_temp, + ) except Exception: _LOGGER.exception( "Cannot update scene %s",