コード例 #1
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.smarthome.core.thing.binding.BaseThingHandler#
  * bridgeHandlerDisposed
  * (org.eclipse.smarthome.core.thing.binding.ThingHandler,
  * org.eclipse.smarthome.core.thing.Bridge)
  */
 @Override
 public void bridgeHandlerDisposed(ThingHandler thingHandler, Bridge bridge) {
   logger.debug(
       "Bridge {} disposed for device: {}",
       bridge.getUID().toString(),
       getThing().getUID().toString());
   bridgeHandler = null;
   forceRefresh = true;
   super.bridgeHandlerDisposed(thingHandler, bridge);
 }
コード例 #2
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.smarthome.core.thing.binding.BaseThingHandler#
  * bridgeHandlerInitialized
  * (org.eclipse.smarthome.core.thing.binding.ThingHandler,
  * org.eclipse.smarthome.core.thing.Bridge)
  */
 @Override
 public void bridgeHandlerInitialized(ThingHandler thingHandler, Bridge bridge) {
   logger.debug(
       "Bridge {} initialized for device: {}",
       bridge.getUID().toString(),
       getThing().getUID().toString());
   if (bridgeHandler != null) {
     bridgeHandler.unregisterDeviceStatusListener(this);
     bridgeHandler = null;
   }
   this.bridgeHandler = (MaxCubeBridgeHandler) thingHandler;
   this.bridgeHandler.registerDeviceStatusListener(this);
   forceRefresh = true;
   super.bridgeHandlerInitialized(thingHandler, bridge);
 }
コード例 #3
0
  @Override
  public void dispose() {

    // stop our duration counter
    if (timeCounterJob != null && !timeCounterJob.isCancelled()) {
      timeCounterJob.cancel(true);
      timeCounterJob = null;
    }

    if (squeezeBoxServerHandler != null) {
      squeezeBoxServerHandler.removePlayerCache(mac);
    }
    logger.debug("Thing {} disposed.", getThing().getUID());
    super.dispose();
  }
コード例 #4
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.smarthome.core.thing.binding.BaseThingHandler#dispose()
  */
 @Override
 public void dispose() {
   logger.debug("Disposing MAX! device {} {}.", getThing().getUID(), maxDeviceSerial);
   if (refreshingActuals) {
     refreshActualsRestore();
   }
   if (refreshActualsJob != null && !refreshActualsJob.isCancelled()) {
     refreshActualsJob.cancel(true);
     refreshActualsJob = null;
   }
   if (bridgeHandler != null) {
     logger.trace("Clear MAX! device {} {} from bridge.", getThing().getUID(), maxDeviceSerial);
     bridgeHandler.clearDeviceList();
     bridgeHandler.unregisterDeviceStatusListener(this);
     bridgeHandler = null;
   }
   updateStatus(ThingStatus.OFFLINE);
   logger.debug("Disposed MAX! device {} {}.", getThing().getUID(), maxDeviceSerial);
   super.dispose();
 }
コード例 #5
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.eclipse.smarthome.core.thing.binding.BaseThingHandler#thingUpdated
  * (org.eclipse.smarthome.core.thing.Thing)
  */
 @Override
 public void thingUpdated(Thing thing) {
   configSet = false;
   forceRefresh = true;
   super.thingUpdated(thing);
 }