code: public function temperatureInCelsius($temperature, $serial_number = NULL) {
          $serial_number = $this->getDefaultSerial($serial_number);
          $temp_scale = $this->getDeviceTemperatureScale($serial_number);
          if ($temp_scale == 'F') {
              return ($temperature - 32) / 1.8;
          }
          return $temperature;
      }
docs: Convert a temperature value from the device-prefered scale to Celsius.
  
  @param float  $temperature   The temperature to convert.
  @param string $serial_number The thermostat serial number. Defaults to the first device of the account.
  
  @return float Temperature in Celsius.