(self, event_data)
return True
Executes the transition.
        Args:
            event_data: An instance of class EventData.
        Returns: boolean indicating whether or not the transition was
            successfully executed (True if successful, False if not).
Executes the transition.
        Args:
            event_data: An instance of class EventData.
        Returns: boolean indicating whether or not the transition was
            successfully executed (True if successful, False if not).
Executes the transition . Args : event_data : An instance of class EventData . Returns : boolean indicating whether or not the transition was successfully executed ( True if successful False if not ) .
async def execute(self, event_data):
        """ Executes the transition.
        Args:
            event_data: An instance of class EventData.
        Returns: boolean indicating whether or not the transition was
            successfully executed (True if successful, False if not).
        """
        _LOGGER.debug("%sInitiating transition from state %s to state %s...",
                      event_data.machine.name, self.source, self.dest)

        await event_data.machine.callbacks(self.prepare, event_data)
        _LOGGER.debug("%sExecuted callbacks before conditions.", event_data.machine.name)

        if not await self._eval_conditions(event_data):
            return False

        machine = event_data.machine
        # cancel running tasks since the transition will happen
        await machine.switch_model_context(event_data.model)

        await event_data.machine.callbacks(event_data.machine.before_state_change, event_data)
        await event_data.machine.callbacks(self.before, event_data)
        _LOGGER.debug("%sExecuted callback before transition.", event_data.machine.name)

        if self.dest:  # if self.dest is None this is an internal transition with no actual state change
            await self._change_state(event_data)

        await event_data.machine.callbacks(self.after, event_data)
        await event_data.machine.callbacks(event_data.machine.after_state_change, event_data)
        _LOGGER.debug("%sExecuted callback after transition.", event_data.machine.name)
        return True
async def execute ( self , event_data ) : _LOGGER . debug ( "%sInitiating transition from state %s to state %s..." , event_data . machine . name , self . source , self . dest ) await event_data . machine . callbacks ( self . prepare , event_data ) _LOGGER . debug ( "%sExecuted callbacks before conditions." , event_data . machine . name ) if not await self . _eval_conditions ( event_data ) : return False machine = event_data . machine # cancel running tasks since the transition will happen await machine . switch_model_context ( event_data . model ) await event_data . machine . callbacks ( event_data . machine . before_state_change , event_data ) await event_data . machine . callbacks ( self . before , event_data ) _LOGGER . debug ( "%sExecuted callback before transition." , event_data . machine . name ) if self . dest : # if self.dest is None this is an internal transition with no actual state change await self . _change_state ( event_data ) await event_data . machine . callbacks ( self . after , event_data ) await event_data . machine . callbacks ( event_data . machine . after_state_change , event_data ) _LOGGER . debug ( "%sExecuted callback after transition." , event_data . machine . name ) return True