Esempio n. 1
0
 @Override
 public void executePowerOff(Config params) {
   /*
    * Not called the setBrightness because this method executeCommand a
    * command here we want only to mantain the system coerent. If we call
    * setBrightness(0, params) the light recalls the onLowerBoundValue.
    * Only ONE command execution per situation
    */
   hue.setValue(0);
   saturation.setValue(0);
   /*
    * executeCommand the body of the super implementation The super call
    * must be the last call as it executes setChanged(true)
    */
   super.executePowerOff(params);
 }
Esempio n. 2
0
  public void setSaturation(int rangeValue, Config params) {
    boolean executed =
        executeCommand(
            "set saturation",
            params); // executes the developer level command associated with 'set brightness' action

    if (executed) {
      powered.setValue(true);
      saturation.setValue(rangeValue);
      // set the light graphical representation
      // getPojo().setCurrentRepresentation(1); //points to the second element in the XML views
      // array (light on image)
      setChanged(true);
    }
  }