Skip to content

Commit

Permalink
Probably final fixes for the integer to string issues from the networ…
Browse files Browse the repository at this point in the history
…king code.
  • Loading branch information
pid1 committed Apr 28, 2015
1 parent 77b0dce commit 07b3d4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server/server.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ public void sendDesiredTemp(String desiredTemperature, String thermostatIP) thro
// Instantiate a printwriter so we can write to the output stream
PrintWriter out = new PrintWriter(sender.getOutputStream(), true);
// Send out the value of desiredTemperature
int desiredTempInt = Integer.parseInt(desiredTemperature);
out.println(desiredTemperature);
int desiredTempInt = Integer.valueOf(desiredTemperature).intValue();
out.println(desiredTempInt);
}
} finally {
// Immediately close the socket when finished
Expand All @@ -126,7 +126,7 @@ public void run() {
int currentTemperature = Integer.parseInt(input.readLine());
// Outputs the current temperature to the console and writes to disk
System.out.printf("The current temperature is: %d \n", currentTemperature);
String currentTempString = Integer.toString(currentTemperature);
currentTempString = Integer.toString(currentTemperature);
} finally {
socket.close();
}
Expand Down

0 comments on commit 07b3d4d

Please sign in to comment.