Advertisement
Guest User

Untitled

a guest
Mar 18th, 2016
2,185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.76 KB | None | 0 0
  1. package com.readyforsky.connection.bluetooth.manager.redmond.protocol.response;
  2.  
  3. public class Kettle171Response extends ByteResponse
  4.   implements ResponseFactory<Kettle171Response>
  5. {
  6.   public Kettle171Response()
  7.   {
  8.   }
  9.  
  10.   public Kettle171Response(byte paramByte, byte[] paramArrayOfByte)
  11.   {
  12.     super(paramByte, paramArrayOfByte);
  13.   }
  14.  
  15.   public Kettle171Response create(byte paramByte, byte[] paramArrayOfByte)
  16.   {
  17.     return new Kettle171Response(paramByte, paramArrayOfByte);
  18.   }
  19.  
  20.   public int getCurrentTemperature()
  21.   {
  22.     if (this.value[10] < 0)
  23.       return 256 + this.value[10];
  24.     return this.value[10];
  25.   }
  26.  
  27.   public int getError()
  28.   {
  29.     return this.value[9];
  30.   }
  31.  
  32.   public int getProgram()
  33.   {
  34.     return this.value[0];
  35.   }
  36.  
  37.   public int getRemainingTimeAsMinutes()
  38.   {
  39.     return 60 * this.value[5] + this.value[6];
  40.   }
  41.  
  42.   public int getRemainingTimeHours()
  43.   {
  44.     return this.value[5];
  45.   }
  46.  
  47.   public int getRemainingTimeMinutes()
  48.   {
  49.     return this.value[6];
  50.   }
  51.  
  52.   public int getSetTemperature()
  53.   {
  54.     return this.value[2];
  55.   }
  56.  
  57.   public int getState()
  58.   {
  59.     return this.value[8];
  60.   }
  61.  
  62.   public boolean isHeating()
  63.   {
  64.     return this.value[7] == 1;
  65.   }
  66.  
  67.   public String toString()
  68.   {
  69.     int i = 1;
  70.     StringBuilder localStringBuilder = new StringBuilder().append("Kettle171Response{program=").append(this.value[0]).append(", setTemperature=").append(this.value[2]).append(", remainingTimeHours=").append(this.value[5]).append(", remainingTimeMinutes=").append(this.value[6]).append(", heating=");
  71.     if (this.value[7] == i);
  72.     while (true)
  73.     {
  74.       return i + ", state=" + this.value[8] + ", error=" + this.value[9] + ", currentTemperature=" + this.value[10] + '}';
  75.       int j = 0;
  76.     }
  77.   }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement