@Override
 public void onNewtempPref(TempStruct arg) {
   // TODO : write code here.
   if (arg.gettempValue() == -100) { // It means that person is leaving the
     // room
     Off(); // Set the Off() command
   } else {
     // If the person is entering to the room then, set temperature
     // according to his preference
     double tempValue = arg.gettempValue();
     TempStruct tempStruct = new TempStruct(tempValue, arg.getunitOfMeasurement());
     SetTemp(tempStruct);
   }
 }
 public void onNewtempMeasurement(TempStruct arg) {
   System.out.println("Temperature value from sensor has been received in RoomAvgTemp");
   System.out.println("Temperature value is " + arg.gettempValue());
   setroomAvgTempMeasurement(new TempStruct(arg.gettempValue() + 25, "C"));
 }