Callback that is called when a transition has ended.

        :param is_on: The on-off state to transition to.
        :param transition: The transition that has ended.
327327
def _transition_callback(self, is_on, transition):
        
        # Update state properties
        if transition.state_stages:
            state = transition.state_stages[transition.stage_index]
            if self.is_on and is_on is False:
                # If led was turned off, set brightness to initial value
                # so that the brightness is restored when it is turned on again
                state['brightness'] = self.brightness
            self.set(is_on=is_on, cancel_transition=False, **state)

        self._active_transition = None
941151
def onClose(self, wasClean):
        
        self.log.error('lost connection to crossbar on session %' + str(self.session_id))
        for task in asyncio.Task.all_tasks():
            task.cancel()
        asyncio.get_event_loop().stop()
944542
def transition(self, duration, brightness=None, temperature=None):
        
        # Transition immediately if duration is zero.
        if duration == 0:
            if brightness is not None:
                self.brightness = brightness
            if temperature is not None:
                self.temperature = temperature
            return
        if brightness != self.brightness or temperature != self.temperature:
            self._transition(duration, brightness, temperature)
1158544
def on_change(self, *callbacks):
        ''' 

        '''
        for callback in callbacks:

            if callback in self._callbacks: continue

            _check_callback(callback, ('event',))

            self._callbacks[callback] = callback
718338
function maybeStart(priv) {
  if (priv.started) {
    return;
  }
  priv.elem.addEventListener(feature.transitionEventName, handleTransitionEnd.bind(null, priv));
  priv.started = true;
}
149477
def on_channel_flow(self, method):
        
        if method.active:
            LOGGER.info('Channel flow is active (READY)')
            self.state = self.STATE_READY
            if self.on_ready:
                self.on_ready(self)
        else:
            LOGGER.warning('Channel flow is inactive (BLOCKED)')
            self.state = self.STATE_BLOCKED
            if self.on_unavailable:
                self.on_unavailable(self)
954126
def on(self, evt, func):
        ''''''
        if evt not in self._callbacks:
            raise NotImplementedError('callback "%s"' % evt)
        else:
            self._callbacks[evt] = func
505186
def transition_to(state)
      ::Instana.logger.debug("Transitioning to #{state}")
      case state
      when :announced
        # announce successful; set state
        @state = :announced

        # Reset the entity timer
        @entity_last_seen = Time.now

      when :unannounced
        @state = :unannounced
        # Reset our HTTP client
        @httpclient = nil

      else
        ::Instana.logger.debug "Uknown agent state: #{state}"
      end
      ::Instana.collector.reset_timer!
      true
    end
454656
def on_finish(self):
        
        super(SessionRequestHandler, self).on_finish()
        LOGGER.debug('Entering SessionRequestHandler.on_finish: %s',
                     self.session.id)
        self.session.last_request_at = self.current_epoch()
        self.session.last_request_uri = self.request.uri
        if self.session.dirty:
            result = yield self.session.save()
            LOGGER.debug('on_finish yield save: %r', result)
        self.session = None
        LOGGER.debug('Exiting SessionRequestHandler.on_finish: %r',
                     self.session)
189829
def on(self):
        """"""
        on_command = StandardSend(self._address,
                                  COMMAND_LIGHT_ON_0X11_NONE, 0xff)
        self._send_method(on_command,
                          self._on_message_received)
737100
def _post_transition(self, result, *args, **kwargs):
        """"""
        for hook in self._filter_hooks(HOOK_AFTER, HOOK_ON_ENTER):
            hook(self.instance, result, *args, **kwargs)
801328
private void fireTransitionEnd(Transition transition) {
        if (mTransitionListener != null && transition != null) {
            mTransitionListener.onTransitionEnd(transition);
        }
    }
1152401
def finish(self):
        
        super(InterruptibleMixin, self).finish()
        signal(SIGINT, self.original_handler)
281221
def add_transition(self, output,
                       probability_func=lambda index: np.ones(len(index), dtype=float),
                       triggered=Trigger.NOT_TRIGGERED):
        
        t = Transition(self, output, probability_func=probability_func, triggered=triggered)
        self.transition_set.append(t)
        return t
751238
def is_switched_on(self, refresh=False):
        
        if refresh:
            self.refresh()
        return self.get_brightness(refresh) > 0
1072050
def select_transition(name, from_state, *conditions)
      if choice_transition?(name, from_state)
        match_transition_with(name, from_state, *conditions)
      else
        match_transition(name, from_state)
      end
    end
538867
public void setNotificationTransitionEnabled(boolean enable) {
        if (mTransitionEnabled != enable) {
            if (DBG) Log.v(TAG, "transition enable - " + enable);
            mTransitionEnabled = enable;
        }
    }