protected void sendIntensity(double intensity){
  if (log.isDebugEnabled()) {
    log.debug("sendIntensity(" + intensity + ")"+ " lastOutputStep: "+ lastOutputStep+ " maxDimStep: "+ maxDimStep);
  }
  int newStep=(int)Math.round(intensity * maxDimStep);
  if ((newStep < 0) || (newStep > maxDimStep)) {
    log.error("newStep wrong: " + newStep + " intensity: "+ intensity);
  }
  if (newStep == lastOutputStep) {
    if (log.isDebugEnabled()) {
      log.debug("intensity " + intensity + " within current step, return");
    }
    return;
  }
  if (log.isDebugEnabled()) {
    log.debug("function set Intensity " + intensity);
  }
  InsteonSequence out=new InsteonSequence();
  out.addFunction(idhighbyte,idmiddlebyte,idlowbyte,Constants.FUNCTION_REQ_STD,Constants.FLAG_STD,Constants.CMD_LIGHT_CHG,newStep);
  tc.sendInsteonSequence(out,null);
  if (log.isDebugEnabled()) {
    log.debug("sendIntensity(" + intensity + ") addr "+ idhighbyte+ idmiddlebyte+ idlowbyte+ " newStep "+ newStep);
  }
  lastOutputStep=newStep;
}

protected void sendIntensity ( double intensity ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "sendIntensity(" + intensity + ")" + " lastOutputStep: " + lastOutputStep + " maxDimStep: " + maxDimStep ) ; } int newStep = ( int ) Math . round ( intensity * maxDimStep ) ; if ( ( newStep < 0 ) || ( newStep > maxDimStep ) ) { log . error ( "newStep wrong: " + newStep + " intensity: " + intensity ) ; } if ( newStep == lastOutputStep ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "intensity " + intensity + " within current step, return" ) ; } return ; } if ( log . isDebugEnabled ( ) ) { log . debug ( "function set Intensity " + intensity ) ; } InsteonSequence out = new InsteonSequence ( ) ; out . addFunction ( idhighbyte , idmiddlebyte , idlowbyte , Constants . FUNCTION_REQ_STD , Constants . FLAG_STD , Constants . CMD_LIGHT_CHG , newStep ) ; tc . sendInsteonSequence ( out , null ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "sendIntensity(" + intensity + ") addr " + idhighbyte + idmiddlebyte + idlowbyte + " newStep " + newStep ) ; } lastOutputStep = newStep ; }
send a dim / bright command to the insteon hardware to reach a specific intensity . acts immediately , and changes no general state . < p > this sends " dim " commands .
