(self, model)
This method is called by an `AsyncTransition` when all conditional tests have passed and the transition will happen.
        This requires already running tasks to be cancelled.
        Args:
            model (object): The currently processed model
This method is called by an `AsyncTransition` when all conditional tests have passed and the transition will happen.
        This requires already running tasks to be cancelled.
        Args:
            model (object): The currently processed model
This method is called by an AsyncTransition when all conditional tests have passed and the transition will happen . This requires already running tasks to be cancelled . Args : model ( object ) : The currently processed model
async def switch_model_context(self, model):
        """
        This method is called by an `AsyncTransition` when all conditional tests have passed and the transition will happen.
        This requires already running tasks to be cancelled.
        Args:
            model (object): The currently processed model
        """
        for running_task in self.async_tasks.get(id(model), []):
            if self.current_context.get() == running_task or running_task in self.protected_tasks:
                continue
            elif running_task.done() is False:
                _LOGGER.debug("Cancel running tasks...")
                running_task.cancel()
async def switch_model_context ( self , model ) : for running_task in self . async_tasks . get ( id ( model ) , [ ] ) : if self . current_context . get ( ) == running_task or running_task in self . protected_tasks : continue elif running_task . done ( ) is False : _LOGGER . debug ( "Cancel running tasks..." ) running_task . cancel ( )