From b9273d2d060eb4350571d54130d3a187b69160fd Mon Sep 17 00:00:00 2001 From: Benjamin Auquite Date: Sat, 8 Apr 2023 13:26:39 -0500 Subject: [PATCH] Revert "Revert "cleaned up"" This reverts commit 11b268148b098af4f790a6f41c8b87b14ea0748a. --- custom_components/adaptive_lighting/switch.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 8b40e9b9..fd894489 100644 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -1234,8 +1234,6 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity): transition: int | None, force: bool, context: Context | None, - adapt_brightness: bool | None = None, - adapt_color: bool | None = None, ) -> None: assert context is not None _LOGGER.debug( @@ -1247,8 +1245,8 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity): context.id, ) - adapt_brightness = adapt_brightness or self.adapt_brightness_switch.is_on - adapt_color = adapt_color or self.adapt_color_switch.is_on + adapt_brightness = self.adapt_brightness_switch.is_on + adapt_color = self.adapt_color_switch.is_on for light in lights: if not is_on(self.hass, light): @@ -1283,7 +1281,7 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity): context.id, ) else: - _fire_manual_control_event(self, light, context, is_async=False) + _fire_manual_control_event(self, light, context) continue await self._adapt_light(light, transition, force=force, context=context)