diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 75f90361..759bc891 100644 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -1137,12 +1137,10 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity): listener = self.turn_on_off_listener last_service_data = listener.last_service_data.get(light) ignore_fields = {ATTR_TRANSITION} - if ( - not force - and last_service_data - and {k for k, _ in last_service_data.items() ^ service_data.items()} - == ignore_fields - ): + differing_fields = { + k for k, _ in last_service_data.items() ^ service_data.items() + } + if not force and last_service_data and differing_fields == ignore_fields: _LOGGER.debug( "%s: Cancelling adapt to light %s, there's no new values to set (context.id='%s')", self._name,